Solaris 10: Set Subnet Mask in Zone

Posted May 25, 2005 by Quinn McHenry in Solaris networking

A netmask setting is not available when creating a zone, and the /etc/netmasks file is not consulted when plumbing up zone interfaces. This tech-recipe describes how to force a netmask when creating a zone.


To configure an IP address of 10.1.1.12 with a class C subnet mask (255.255.255.0, a 24 bit mask) on physical interface bge0, use these commands when running zonecfg to create the zone. (Substitute your IP address, netmask length, and physical interface as appropriate.):

zonecfg:testzone>add net
zonecfg:testzone:net>set physical=bge0
zonecfg:testzone:net>set address=10.1.1.12/24
zonecfg:testzone:net>end
. . .

This configuration is only necessary when using a non-standard netmask.

 

About Quinn McHenry

Quinn was one of the original co-founders of Tech-Recipes. He is currently crafting iOS applications as a senior developer at Small Planet Digital in Brooklyn, New York.
View more articles by Quinn McHenry

The Conversation

Follow the reactions below and share your own thoughts.