netdev
[Top] [All Lists]

Re: primary and secondary ip addresses

To: Henrik Nordstrom <hno@xxxxxxxxxxxxxxx>
Subject: Re: primary and secondary ip addresses
From: Harald Welte <laforge@xxxxxxxxxxxx>
Date: Thu, 16 Dec 2004 10:28:32 +0100
Cc: Neil Horman <nhorman@xxxxxxxxxx>, linux-net@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxx
In-reply-to: <Pine.LNX.4.61.0411100034320.10593@filer.marasystems.com>
References: <41912F7A.6000408@redhat.com> <Pine.LNX.4.61.0411100034320.10593@filer.marasystems.com>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mutt/1.5.6+20040907i
[Cc'ing netdev, since nobody replied since november]

On Wed, Nov 10, 2004 at 12:38:19AM +0100, Henrik Nordstrom wrote:
> On Tue, 9 Nov 2004, Neil Horman wrote:
> 
> >Can anyone tell me why when removing a primary ip address from an 
> >interface, all of its associated secondary ip addresses (those addresses 
> >on the same subnet), are also removed?  Theres a comment in the kernel 
> >thats pretty clear on the subject indicating it needs to be done, but I 
> >don't quite grasp the reasoning behind why.
> 
> A more valid question is why one can not add more than one primary in the 
> same subnet.
> 
> ip addr add x.x.x.x/y dev eth0 primary
> 
> would make sense to me, clearly indicating that these addresses are 
> maintained separately.

agreed.

> or put in another way why the addresses automatically become secondary 
> addresses to the first added address.

... and why does removing the primary address remove all secondary
addresses.  This makes it complicated if you have one interface with
multiple ip addresse, that change over time (failover, let's say.)  You
don't know yet, which address you need to remove, because you don't know
which of your peers fails. 

So you have all this complicated userspace magic that checks whether the
address that is about to be deleted is the primary, and if yes, re-add
all the other addresses.  If if is a secondary, you're happy and only
need to delete that one.

Can anyone comment what the idea of all this was?

Thanks.

-- 
- Harald Welte <laforge@xxxxxxxxxxxx>               http://www.gnumonks.org/
============================================================================
Programming is like sex: One mistake and you have to support it your lifetime

Attachment: signature.asc
Description: Digital signature

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