Subject: Re: always print IPv4 alias addresses
To: Erik E. Fair <fair@clock.org>
From: Michael Richardson <mcr@sandelman.ottawa.on.ca>
List: tech-net
Date: 04/29/2001 17:40:20
>>>>> "Erik" == Erik E Fair <fair@clock.org> writes:
    Erik> At 16:42 -0700 4/27/01, Jason R Thorpe wrote:

    >> Sounds good to me.  The whole notion of "aliases" seems silly to me,
    >> really... they're just addresses on an interface.  I think the only
    >> reason we have "alias" is because ifconfig and its ioctls were poorly
    >> designed in the first place :-)

    Erik> Um, well, there is the question of what IP address gets stuffed into 
    Erik> a packet without one (i.e. most applications don't bother to set one, 
    Erik> so you get one from the interface that the routing table decides to 
    Erik> send the packet out), and that marks the difference between the 
    Erik> interface's "address" and an "alias".

  Not really.
  The outgoing address is picked via a route entry to that destination
just like in multihoming.

  If you do:

ifconfig ep0 inet 192.0.0.1 up
ifconfig ep0 inet 1.2.3.4 netmask 255.255.255.0 alias
route add -net 4.5.6.0 1.2.3.9

  and then connect to 4.5.6.7, then you will find that your source
address is 1.2.3.4, not 192.0.0.1.

 Michael Richardson
 Solidum Systems Corporation  
 mcr@solidum.com
 http://www.solidum.com