Subject: Re: primary and secondary ip addresses

From: Andrea G Forte <[email-masked]>
Date: Fri, 17 Dec 2004 10:58:10 -0500

> Which source IP is used by the kernel is determined primary by your 
> routing tables.
>
> The requirements for an IP address to be allowed to be used in the 
> routing table is that the IP address does exists on any of your 
> interfaces, either as primary or secondary.
>
> When you add/delete a primary address to a interface the kernel 
> automatically adds/deletes routes accordingly, including source IP 
> address selection.
>
This does not help, since if I want to use my secondary IP address 
instead of my primary, I cannot delete the primary otherwise all of my 
secondary IPs are lost as well (and since I can only have only one 
primary IP address).

> If the routing table does not have information about which source IP 
> address to use for this traffic then the kernel searches the interface 
> for a valid primary address.
>
I update all the routing entries and eventually things start to work 
again. The problem is that:
-If I use a secondary IP and try to invalidate the primary (i.e. by 
removing its routing table entry), it takes about 500ms for the actual 
change (data packets sent on the secondary IP instead of the primary) to 
take effect.
-If I try to update the primary address directly without creating any 
secondary IP, then it still takes about 300ms for the change to take place.

I honestly do not understand what harm could do to have more than one 
primary address, especially on different subnets.

Cheers,
Andrea

> Regards
> Henrik