[Top] [All Lists]

Re: primary and secondary ip addresses

To: "Martin A. Brown" <mabrown@xxxxxxxxxxxxxx>
Subject: Re: primary and secondary ip addresses
From: Hasso Tepper <hasso@xxxxxxxxx>
Date: Fri, 17 Dec 2004 20:53:27 +0200
Cc: Henrik Nordstrom <hno@xxxxxxxxxxxxxxx>, Andrea G Forte <andreaf@xxxxxxxxxxxxxxx>, Harald Welte <laforge@xxxxxxxxxxxx>, Neil Horman <nhorman@xxxxxxxxxx>, linux-net@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxx
In-reply-to: <Pine.LNX.4.61.0412171206200.10943@xxxxxxxxxxxxxxxxxxxxxxxxxx>
Organization: Elion Enterprises Ltd.
References: <41912F7A.6000408@xxxxxxxxxx> <200412172003.22319.hasso@xxxxxxxxx> <Pine.LNX.4.61.0412171206200.10943@xxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: KMail/1.7.2
Ühel kenal päeval (reede 17 detsember 2004 20:37) kirjutas Martin A. Brown:
> Hello Hasso and Andrea,
> We've gotten a little far afield from Neil Horman's initial question
> about why there are primary and secondary IPs, and I can't address your
> concern Andrea about the (route cache?) 500ms latency between the time
> that an address is added (or removed) from an interface and the time that
> the address is actually used.  Even so, the Linux routing code allows the
> kernel to suggest an IP with the "src" keyword.

I know.

>  : > Why change the primary address? What is wrong with simply changing
>  : > the route to use the other source IP?
>  :
>  : There is no support for it in most of user space software.
>  : None of the routing protocols suites support it etc.
> Though some software provides support for explicit configuration of
> source address for initiated sockets, you can use INADDR_ANY and let the
> kernel perform source address selection for you.

Well, that's the point - we want to have full control over this selection 
process without doing fancy things in user space. 

> Linux select an IP based on the routing table. [0]  Example:
>   # ip route show
> dev eth0  scope link  src
>   # ip route change dev eth0 scope link src $SECONDARY
> If you want to be fancy about it, you can have a higher preference
> routing table (make sure there's an entry in /etc/iproute2/rt_tables for
> $SECONDARY_TABLE).  Then you can add and remove tables in this routing
> table instead of changing the route in the main routing table.
>   # ip rule add prio table $SECONDARY_TABLE
>   # ip route add table $SECONDARY_TABLE $DESTNET dev $REALDEV src

All these tricks don't help if you are using dynamic routing.

Hasso Tepper
Elion Enterprises Ltd.
WAN administrator

<Prev in Thread] Current Thread [Next in Thread>