Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Aug 2011 23:49:21 +0000
From:      John <jwd@freebsd.org>
To:        FreeBSD Net <freebsd-net@freebsd.org>
Subject:   ifconfig -alias with duplicate netmasks work?
Message-ID:  <20110822234921.GA34843@FreeBSD.org>

next in thread | raw e-mail | index | archive | help
Fellow Net'ers

   Debugging an nfs locking problem to a linux host, I accidently
issued some ifconfig commands on the bsd server (9-current) and
found that duplicate netmasks seem to work fine. For instance:

bce0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	options=c01bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,VLAN_HWTSO,LINKSTATE>
	ether d4:85:64:66:2a:14
	inet6 fe80::d685:64ff:fe66:2a14%bce0 prefixlen 64 scopeid 0x1 
	inet 10.24.99.127 netmask 0xffff0000 broadcast 10.24.255.255
	inet 10.24.99.128 netmask 0xffff0000 broadcast 10.24.255.255
	inet 10.24.99.126 netmask 0xffff0000 broadcast 10.24.255.255
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
	media: Ethernet autoselect (1000baseT <full-duplex>)
	status: active

via the commands:

ifconfig bce0 inet 10.24.99.127 netmask 0xffff0000 broadcast 10.24.255.255
ifconfig bce0 inet 10.24.99.128 netmask 0xffff0000 broadcast 10.24.255.255 alias
ifconfig bce0 inet 10.24.99.126 netmask 0xffff0000 broadcast 10.24.255.255 alias

The man page for ifconfig says one 'must' use a different netmask,
typically 0xffffffff. However, everything still seems to work ok.

Has something changed, is the manpage wrong, am I totally missing
something?

Thanks,
John

man ifconfig

If the address
is on the same subnet as the first network address for this
interface, a non-conflicting netmask must be given.  Usually
0xffffffff is most appropriate.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110822234921.GA34843>