Subject: Re: "rotating" IPv4 addresses - bug or feature?
To: None <tech-net@NetBSD.org>
From: Jukka Salmi <j+nbsd@2007.salmi.ch>
List: tech-net
Date: 07/12/2007 14:03:48
David Young --> tech-net (2007-07-11 13:06:03 -0500):
> On Wed, Jul 11, 2007 at 12:53:05PM +0200, Jukka Salmi wrote:
[...]
> > $ ifconfig vr0
> > vr0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
> > [...]
> > inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255
> > inet alias 192.168.0.2 netmask 0xffffff00 broadcast 192.168.0.255
> > inet alias 192.168.0.3 netmask 0xffffff00 broadcast 192.168.0.255
> >
> > $ ifconfig vr0 inet 192.168.0.1/24
> > $ ifconfig vr0
> > vr0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
> > [...]
> > inet 192.168.0.2 netmask 0xffffff00 broadcast 192.168.0.255
> > inet alias 192.168.0.3 netmask 0xffffff00 broadcast 192.168.0.255
> > inet alias 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255
> >
> > $ ifconfig vr0 inet 192.168.0.1/24
> > $ ifconfig vr0
> > vr0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
> > [...]
> > inet 192.168.0.3 netmask 0xffffff00 broadcast 192.168.0.255
> > inet alias 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255
> >
> > Huh, 192.168.0.2 is gone...
>
> You have to use the 'alias' keyword, or else the kernel will replace the
> first address instead of adding an address.
I didn't want to add a new address. I just wanted to point out that
if I "add" the already existing first address, then the addresses are
rotated; and if I "add" it again, then the first alias address
disappears. In other words, the first address was not replaced.
Regards, Jukka
--
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~