Subject: Re: mutating IPv4 aliases on NetBSD 2 systems
To: None <>
From: David Young <>
List: tech-net
Date: 02/25/2006 01:26:27
On Fri, Feb 24, 2006 at 01:51:04PM +0100, Jukka Salmi wrote:
> Hi,
> I'm seeing very strange (at least to me) behaviour on two i386 systems
> running NetBSD 2.1_STABLE. They have one ethernet interface each, and
> they both use IPv4 aliases. Since the problem is the same on both
> systems, I'll describe it for only one of them.
> The interface is configured as follows:
> $ cat /etc/ifconfig.fxp0
> inet media autoselect
> inet alias
> inet alias
> up
> This worked fine so far, until today (uptime was about 26 days) I
> noticed that running wol(1) (a wake-on-lan tool, pkgsrc/net/wol) didn't
> work as usual: it somehow did not manage to send the magick packet,
> but did not print an error message; ifconfig(8) revealed:
> $ ifconfig fxp0
> 	address: 00:02:a5:1c:cb:58
> 	media: Ethernet autoselect (100baseTX full-duplex)
> 	status: active
> 	inet netmask 0xffffffff broadcast
> 	inet alias netmask 0xffffffff broadcast
> 	inet alias netmask 0xfffffff0 broadcast
> Hmm, this is not what I had expected! Notice the addresses don't match
> the configuration: is an alias now, and
> is not an alias anymore! At least the netmasks and broadcast addresses
> did not change...

I have seen dhclient cause "aliases" and non-"aliases" to "rotate" in
this way.  I suspect '/etc/rc.d/network restart' could also rotate them.
Others have already described how BSD's aliases are deficient....

FWIW, I have patches for the kernel and for ifconfig that let me apply
a preference number to an address: for a socket bound to INADDR_ANY,
the kernel chooses a source address with the least preference number,
after it chooses the output interface.  There are other goodies in
the patch that let me set many useful IPv4 source address policies;
the policies are extensible, too.  Someday I will commit the patches;
in the mean time, they are available upon request.


David Young             OJC Technologies      Urbana, IL * (217) 278-3933