Subject: Re: better ARP handling in IPv4 alias address
To: Jun-ichiro itojun Hagino <itojun@iijlab.net>
From: Andrew Brown <atatat@atatdot.net>
List: tech-net
Date: 07/03/2001 20:56:40
>>for this to work really well, i feel that there should be a way to
>>*insert* an address at the head of the list of addresses for a given
>>interface.
>>
>>i've had "problems" where the "primary" ipv4 address was removed via
>>"-alias" and then a new address was added via "alias".
>>
>>"alias" adds to the end of list, "-alias" removes arbitrarily from the
>>list, "delete" removes the head of the list, and the absence of the
>>alias keyword *sets* the head of the list (at the same time deleting
>>what was there).  the "insert at the head of the list" bit is missing.
>
>	you can use the following:
>	# ifconfig wi0 <secondary address> -alias
>
>	for IPv6, we forbid the following form as IPv4 behavior assumed that
>	the primary (1st one) gets removed, and it is a bad assumption to make.
>	# ifconfig wi0 -alias

i think i'm not being clear here, because your answer doesn't seem to
address what i see as the problem.  here's an example.  i have this:

this# ifconfig ep0
ep0: flags=8863<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        address: 00:10:4b:9f:ab:87
        media: Ethernet 10baseT
        inet 206.223.36.134 netmask 0xffffff80 broadcast 206.223.36.255
        inet alias 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255
        inet alias 192.168.0.2 netmask 0xffffff00 broadcast 192.168.0.255
        inet6 fe80::210:4bff:fe9f:ab87%ep0 prefixlen 64 scopeid 0x26

and if i want to change the primary address to something else, i have
to remove all the addresses and re-add them, otherwise this happens:

this# ifconfig ep0 206.223.36.134 -alias
this# ifconfig ep0 206.223.36.136 netmask 0xffffff80
this# ifconfig ep0
ep0: flags=8863<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        address: 00:10:4b:9f:ab:87
        media: Ethernet 10baseT
        inet 192.168.0.2 netmask 0xffffff00 broadcast 192.168.0.255
        inet alias 206.223.36.136 netmask 0xffffff80 broadcast 206.223.36.255
        inet6 fe80::210:4bff:fe9f:ab87%ep0 prefixlen 64 scopeid 0x26

which is suboptimal, since i need the 206 address to be the "primary",
and i've lost one of the aliases.  i guess i could just "assume" that
the address being replaced is at the head...but i still think there
ought to be a way to insert at the head.

-- 
|-----< "CODE WARRIOR" >-----|
codewarrior@daemon.org             * "ah!  i see you have the internet
twofsonet@graffiti.com (Andrew Brown)                that goes *ping*!"
andrew@crossbar.com       * "information is power -- share the wealth."