SUMMARY: Setting a 255.255.255.255 Netmask

From: Crist Clark <Crist.Clark_at_globalstar.com>
Date: Tue Oct 07 2008 - 15:16:37 EDT
I got a number of replies, mostly people wondering why the
heck I was doing this. Believe me, I do have a reason.

But thanks to Peter van Gemert who helpfully pointed out that
the following syntax,

	zonecfg:zone1> add net
	zonecfg:zone1:net> set physical=bge0
	zonecfg:zone1:net> set address=192.168.222.18/32
	zonecfg:zone1:net> end

Is valid and works as desired.

I went back to the documentation, zonecfg(1M) page, and sure
enough, this is in there, but I never noticed it before,

     net: address, physical

         The network address and physical interface name  of  the
         network interface. The network address is one of:

           o  a valid IPv4 address, optionally  followed  by  "/"
              and a prefix length;

But the consensus seems to be that the netmasks(4) file is a
little too smart for its own good and the libraries backing
it don't deal with >30-bit netmasks well.

On 10/6/2008 at 11:14 AM, "Crist Clark" <Crist.Clark@globalstar.com> wrote:
> I've got a situation where I want to assign a 255.255.255.255
> netmask to an interface. It's easy enough to do with the
> ifconfig(1M) command,
>
> 	# ifconfig bge2 plumb 192.168.222.18 netmask 255.255.255.255 broadcast
> 255.255.255.255
> 	# ifconfig bge2
> 	bge2: flags=1000802<BROADCAST,MULTICAST,IPv4> mtu 1500 index 6
> 	        inet 192.168.222.18 netmask ffffffff broadcast 255.255.255.255
> 	        ether 0:14:4f:a2:ee:98
>
> But if I add,
>
> 	192.168.222.18	255.255.255.255
>
> To the netmasks(4) file, I get this,
>
> 	# ifconfig bge2 plumb 192.168.222.18 netmask + broadcast +
> 	Need net number for mask
> 	# ifconfig bge2
> 	bge2: flags=1000802<BROADCAST,MULTICAST,IPv4> mtu 1500 index 7
> 	        inet 192.168.222.18 netmask ffffff00 broadcast 192.168.222.255
> 	        ether 0:14:4f:a2:ee:98
>
> It gives an error message and the classful (in this case, Class C0)
> address for the network number.
>
> Now, I could just do this "manually" in the hostname.bge2 file, but
> I actually want to do this in a non-global zone. I don't know how
> to pass extra ifconfig(1M) parameters into the configuration of a
> zone's interfaces via the "add net" in zonecfg(1M). How do I get
> a 255.255.255.255 netmask on a non-global zone. I guess I could still
> kludge up a hostname.bge2:1 to do it, but is there a "cleaner" way?
> (I know of whole 'nother approach to this, but have never tried that
> in a zone either.)
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
Received on Tue Oct 7 15:19:36 2008

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:44:12 EST