Subject: Re: RFC: local address selection
To: Emmanuel Dreyfus <manu@netbsd.org>
From: Tom Ivar Helbekkmo <tih@eunetnorge.no>
List: tech-net
Date: 11/07/2004 19:45:15
manu@netbsd.org (Emmanuel Dreyfus) writes:

> Beside having the same local address selected for any protocol, I
> really need to be able to set a "prefered" local address.

Hear! Hear!  I've missed this many times.

> Each interface could have its prefered local address.

In the situation where multiple IP addresses on the same network live
on the same interface, this could be nice.  Of course, just falling
back on the primary (non-alias) address in each case is sort of
sufficient, but changing the preferred local address with a single
ifconfig statement is much easier than deleting the primary address
and one alias, then recreating them in each other's places.

> Or each route could have its prefered local address:
> route add default 10.0.12.1 -localaddr 10.0.12.7   
>
> The latter sounds the most general, so it might be the best way to go.

Absolutely.  This is exactly the thing I've needed, in situations
where I've ended up separately configuring it for each application
that *could* specify its local address, and just living with the fact
that those that couldn't, ended up with the wrong one.

The per route preferred local address covers the per interface one,
and is a more general, and more elegant, solution.  I say do it.  :-)

Oh, and it needs to be possible to specify a local address that isn't
actually on the outgoing interface, but is a local address on another
interface, and is thus still reachable for the return traffic.  This
would be used to route traffic out through more than one interface,
while always having it originate at the system's primary address.

-tih
-- 
Tom Ivar Helbekkmo, Senior System Administrator, EUnet Norway Hosting
www.eunet.no  T +47-22092958 M +47-93013940 F +47-22092901 FWD 484145