All of lore.kernel.org
 help / color / mirror / Atom feed
* [LARTC] ip address delete bug?
@ 2005-10-03 17:55 Carl-Daniel Hailfinger
  2005-10-03 18:00 ` Peter Surda
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Carl-Daniel Hailfinger @ 2005-10-03 17:55 UTC (permalink / raw)
  To: lartc

Hi,

it seems that "ip address delete" will delete all addresses of the same 
class on an interface if it is ordered to only delete the first one:

# ip a f eth0
# ip a l eth0
3: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
     link/ether xx:xx:xx:xx:xx:xx
# ip a a 192.168.a.b brd + dev eth0
# ip a a 192.168.c.d brd + dev eth0
# ip a d 192.168.a.b brd + dev eth0
# ip a l eth0
3: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
     link/ether xx:xx:xx:xx:xx:xx

I'm using kernel 2.6.13 and iproute2-050816. The man page seems to agree 
with me that this behaviour is wrong. If that behaviour is intended, 
please update the man page.

Regards,
Carl-Daniel
-- 
http://www.hailfinger.org/
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [LARTC] ip address delete bug?
  2005-10-03 17:55 [LARTC] ip address delete bug? Carl-Daniel Hailfinger
@ 2005-10-03 18:00 ` Peter Surda
  2005-10-04 19:11 ` Carl-Daniel Hailfinger
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 13+ messages in thread
From: Peter Surda @ 2005-10-03 18:00 UTC (permalink / raw)
  To: lartc

On Mon, 03 Oct 2005 19:55:09 +0200 Carl-Daniel Hailfinger
<c-d.hailfinger.devel.2005@gmx.net> wrote:

>Hi,
hi

>it seems that "ip address delete" will delete all addresses of the same
>class on an interface if it is ordered to only delete the first one:
Incidentally I encountered similar behavior with kernel 2.4 and older iproute
(20010824 with some patches) a couple of weeks ago, so it's nothing new.

>Regards,
>Carl-Daniel
Yours sincerely,
Peter

-- 
http://www.shurdix.org - Linux distribution for routers and firewalls
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [LARTC] ip address delete bug?
  2005-10-03 17:55 [LARTC] ip address delete bug? Carl-Daniel Hailfinger
  2005-10-03 18:00 ` Peter Surda
@ 2005-10-04 19:11 ` Carl-Daniel Hailfinger
  2005-10-04 21:23     ` Alexey Toptygin
  2005-10-04 23:20 ` [LARTC] " Peter Surda
  2005-10-04 23:23 ` Stephen Hemminger
  3 siblings, 1 reply; 13+ messages in thread
From: Carl-Daniel Hailfinger @ 2005-10-04 19:11 UTC (permalink / raw)
  To: lartc

Hi,

Peter Surda schrieb:
> On Mon, 03 Oct 2005 19:55:09 +0200 Carl-Daniel Hailfinger
> <c-d.hailfinger.devel.2005@gmx.net> wrote:
> 
> 
>>it seems that "ip address delete" will delete all addresses of the same
>>class on an interface if it is ordered to only delete the first one:
> 
> Incidentally I encountered similar behavior with kernel 2.4 and older iproute
> (20010824 with some patches) a couple of weeks ago, so it's nothing new.

OK, I found out that this is documented behaviour, although the hint is 
not in the man page.

"secondary --- this address is not used when selecting the default 
source address for outgoing packets. An IP address becomes secondary if 
another address within the same prefix (network) already exists. The 
first address within the prefix is primary and is the tag address for 
the group of all the secondary addresses. When the primary address is 
deleted all of the secondaries are purged too."

That means there is no way to change the IP of an interface if the 
prefix and network size stay the same. Are there any plans to fix that?


> Yours sincerely,
> Peter

Regards,
Carl-Daniel
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [LARTC] ip address delete bug?
  2005-10-04 19:11 ` Carl-Daniel Hailfinger
@ 2005-10-04 21:23     ` Alexey Toptygin
  0 siblings, 0 replies; 13+ messages in thread
From: Alexey Toptygin @ 2005-10-04 21:23 UTC (permalink / raw)
  To: Carl-Daniel Hailfinger; +Cc: lartc, netdev

On Tue, 4 Oct 2005, Carl-Daniel Hailfinger wrote:

> OK, I found out that this is documented behaviour, although the hint is not 
> in the man page.

If it's not in the man page, then where is the below quote from?

> "secondary --- this address is not used when selecting the default source 
> address for outgoing packets. An IP address becomes secondary if another 
> address within the same prefix (network) already exists. The first address 
> within the prefix is primary and is the tag address for the group of all the 
> secondary addresses. When the primary address is deleted all of the 
> secondaries are purged too."
>
> That means there is no way to change the IP of an interface if the prefix and 
> network size stay the same. Are there any plans to fix that?

What's wrong with delete followed by add?

This thread started on netdev, so I'm cc-ing that, in case someone doesn't 
read both lists.

 			Alexey
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: ip address delete bug?
@ 2005-10-04 21:23     ` Alexey Toptygin
  0 siblings, 0 replies; 13+ messages in thread
From: Alexey Toptygin @ 2005-10-04 21:23 UTC (permalink / raw)
  To: Carl-Daniel Hailfinger; +Cc: lartc, netdev

On Tue, 4 Oct 2005, Carl-Daniel Hailfinger wrote:

> OK, I found out that this is documented behaviour, although the hint is not 
> in the man page.

If it's not in the man page, then where is the below quote from?

> "secondary --- this address is not used when selecting the default source 
> address for outgoing packets. An IP address becomes secondary if another 
> address within the same prefix (network) already exists. The first address 
> within the prefix is primary and is the tag address for the group of all the 
> secondary addresses. When the primary address is deleted all of the 
> secondaries are purged too."
>
> That means there is no way to change the IP of an interface if the prefix and 
> network size stay the same. Are there any plans to fix that?

What's wrong with delete followed by add?

This thread started on netdev, so I'm cc-ing that, in case someone doesn't 
read both lists.

 			Alexey

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [LARTC] ip address delete bug?
  2005-10-04 21:23     ` Alexey Toptygin
@ 2005-10-04 22:58       ` Carl-Daniel Hailfinger
  -1 siblings, 0 replies; 13+ messages in thread
From: Carl-Daniel Hailfinger @ 2005-10-04 22:58 UTC (permalink / raw)
  To: Alexey Toptygin; +Cc: lartc, netdev

Alexey Toptygin schrieb:
> On Tue, 4 Oct 2005, Carl-Daniel Hailfinger wrote:
> 
>> OK, I found out that this is documented behaviour, although the hint 
>> is not in the man page.
> 
> If it's not in the man page, then where is the below quote from?

ip-cref.tex.

>> "secondary --- this address is not used when selecting the default 
>> source address for outgoing packets. An IP address becomes secondary 
>> if another address within the same prefix (network) already exists. 
>> The first address within the prefix is primary and is the tag address 
>> for the group of all the secondary addresses. When the primary address 
>> is deleted all of the secondaries are purged too."
>>
>> That means there is no way to change the IP of an interface if the 
>> prefix and network size stay the same. Are there any plans to fix that?
> 
> What's wrong with delete followed by add?

You are logged into the machine via ssh on eth0. You delete the ip 
address of eth0. How are you going to add the new address to eth0 now 
that your connection is gone? Go to the server room and use the console?

Normally, I would add the new IP to eth0, start another ssh to the new 
IP, log out from the session to the old IP, remove the old IP from eth0 
and be done. If I want the server to be reachable under both IPs during 
a transition period, I can delay deletion of the old IP until later.

> This thread started on netdev, so I'm cc-ing that, in case someone 
> doesn't read both lists.

Didn't start there, but if netdev is interested, we can keep them in cc.


>             Alexey

Regards,
Carl-Daniel
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: ip address delete bug?
@ 2005-10-04 22:58       ` Carl-Daniel Hailfinger
  0 siblings, 0 replies; 13+ messages in thread
From: Carl-Daniel Hailfinger @ 2005-10-04 22:58 UTC (permalink / raw)
  To: Alexey Toptygin; +Cc: lartc, netdev

Alexey Toptygin schrieb:
> On Tue, 4 Oct 2005, Carl-Daniel Hailfinger wrote:
> 
>> OK, I found out that this is documented behaviour, although the hint 
>> is not in the man page.
> 
> If it's not in the man page, then where is the below quote from?

ip-cref.tex.

>> "secondary --- this address is not used when selecting the default 
>> source address for outgoing packets. An IP address becomes secondary 
>> if another address within the same prefix (network) already exists. 
>> The first address within the prefix is primary and is the tag address 
>> for the group of all the secondary addresses. When the primary address 
>> is deleted all of the secondaries are purged too."
>>
>> That means there is no way to change the IP of an interface if the 
>> prefix and network size stay the same. Are there any plans to fix that?
> 
> What's wrong with delete followed by add?

You are logged into the machine via ssh on eth0. You delete the ip 
address of eth0. How are you going to add the new address to eth0 now 
that your connection is gone? Go to the server room and use the console?

Normally, I would add the new IP to eth0, start another ssh to the new 
IP, log out from the session to the old IP, remove the old IP from eth0 
and be done. If I want the server to be reachable under both IPs during 
a transition period, I can delay deletion of the old IP until later.

> This thread started on netdev, so I'm cc-ing that, in case someone 
> doesn't read both lists.

Didn't start there, but if netdev is interested, we can keep them in cc.


>             Alexey

Regards,
Carl-Daniel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [LARTC] ip address delete bug?
  2005-10-04 22:58       ` Carl-Daniel Hailfinger
@ 2005-10-04 23:08         ` Alexey Toptygin
  -1 siblings, 0 replies; 13+ messages in thread
From: Alexey Toptygin @ 2005-10-04 23:08 UTC (permalink / raw)
  To: Carl-Daniel Hailfinger; +Cc: lartc, netdev

On Wed, 5 Oct 2005, Carl-Daniel Hailfinger wrote:

>>> "secondary --- this address is not used when selecting the default source 
>>> address for outgoing packets. An IP address becomes secondary if another 
>>> address within the same prefix (network) already exists. The first address 
>>> within the prefix is primary and is the tag address for the group of all 
>>> the secondary addresses. When the primary address is deleted all of the 
>>> secondaries are purged too."
>>> 
>>> That means there is no way to change the IP of an interface if the prefix 
>>> and network size stay the same. Are there any plans to fix that?
>> 
>> What's wrong with delete followed by add?
>
> You are logged into the machine via ssh on eth0. You delete the ip address of 
> eth0. How are you going to add the new address to eth0 now that your 
> connection is gone? Go to the server room and use the console?
>
> Normally, I would add the new IP to eth0, start another ssh to the new IP, 
> log out from the session to the old IP, remove the old IP from eth0 and be 
> done. If I want the server to be reachable under both IPs during a transition 
> period, I can delay deletion of the old IP until later.

Then I guess the question is: does anything in common use depend on the 
old behavior?

 			Alexey
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: ip address delete bug?
@ 2005-10-04 23:08         ` Alexey Toptygin
  0 siblings, 0 replies; 13+ messages in thread
From: Alexey Toptygin @ 2005-10-04 23:08 UTC (permalink / raw)
  To: Carl-Daniel Hailfinger; +Cc: lartc, netdev

On Wed, 5 Oct 2005, Carl-Daniel Hailfinger wrote:

>>> "secondary --- this address is not used when selecting the default source 
>>> address for outgoing packets. An IP address becomes secondary if another 
>>> address within the same prefix (network) already exists. The first address 
>>> within the prefix is primary and is the tag address for the group of all 
>>> the secondary addresses. When the primary address is deleted all of the 
>>> secondaries are purged too."
>>> 
>>> That means there is no way to change the IP of an interface if the prefix 
>>> and network size stay the same. Are there any plans to fix that?
>> 
>> What's wrong with delete followed by add?
>
> You are logged into the machine via ssh on eth0. You delete the ip address of 
> eth0. How are you going to add the new address to eth0 now that your 
> connection is gone? Go to the server room and use the console?
>
> Normally, I would add the new IP to eth0, start another ssh to the new IP, 
> log out from the session to the old IP, remove the old IP from eth0 and be 
> done. If I want the server to be reachable under both IPs during a transition 
> period, I can delay deletion of the old IP until later.

Then I guess the question is: does anything in common use depend on the 
old behavior?

 			Alexey

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [LARTC] ip address delete bug?
  2005-10-03 17:55 [LARTC] ip address delete bug? Carl-Daniel Hailfinger
  2005-10-03 18:00 ` Peter Surda
  2005-10-04 19:11 ` Carl-Daniel Hailfinger
@ 2005-10-04 23:20 ` Peter Surda
  2005-10-04 23:23 ` Stephen Hemminger
  3 siblings, 0 replies; 13+ messages in thread
From: Peter Surda @ 2005-10-04 23:20 UTC (permalink / raw)
  To: lartc

On Wed, 05 Oct 2005 00:58:19 +0200 Carl-Daniel Hailfinger
<c-d.hailfinger.devel.2005@gmx.net> wrote:

 via ssh on eth0. You delete the ip
>address of eth0. How are you going to add the new address to eth0 now
>that your connection is gone? Go to the server room and use the console?
(btw exactly the thing that happened to me)
but the solution is easy, put everything into one line:
ip addr del blah1 dev eth0;ip addr add blah2 dev eth0;ip link set eth0 up
;-)

>Regards,
>Carl-Daniel
Yours sincerely,
Peter

-- 
http://www.shurdix.org - Linux distribution for routers and firewalls
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [LARTC] ip address delete bug?
  2005-10-03 17:55 [LARTC] ip address delete bug? Carl-Daniel Hailfinger
                   ` (2 preceding siblings ...)
  2005-10-04 23:20 ` [LARTC] " Peter Surda
@ 2005-10-04 23:23 ` Stephen Hemminger
  3 siblings, 0 replies; 13+ messages in thread
From: Stephen Hemminger @ 2005-10-04 23:23 UTC (permalink / raw)
  To: lartc

Current versions of iproute2 display the following:

Warning: Executing wildcard deletion to stay compatible with old scripts.
         Explicitly specify the prefix length (192.168.a.b/32) to avoid this warning.
         This special behaviour is likely to disappear in further releases,
         fix your scripts!
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [LARTC] ip address delete bug?
       [not found]         ` <1128474946.6224.8.camel@localhost.localdomain>
@ 2005-10-05 15:32             ` Carl-Daniel Hailfinger
  0 siblings, 0 replies; 13+ messages in thread
From: Carl-Daniel Hailfinger @ 2005-10-05 15:32 UTC (permalink / raw)
  To: hadi; +Cc: lartc, netdev

jamal wrote:
> On Tue, 2005-04-10 at 23:08 +0000, Alexey Toptygin wrote:
> 
>>On Wed, 5 Oct 2005, Carl-Daniel Hailfinger wrote:
> 
> [..]
> 
>>>Normally, I would add the new IP to eth0, start another ssh to the new IP, 
>>>log out from the session to the old IP, remove the old IP from eth0 and be 
>>>done. If I want the server to be reachable under both IPs during a transition 
>>>period, I can delay deletion of the old IP until later.
>>
>>Then I guess the question is: does anything in common use depend on the 
>>old behavior?
> 
> There's a new feature in newer kernels which allows for an alias to be
> upgraded to become primary when you delete the primary. You need to
> configure the sysctl otherwise it defaults to purging all the
> secondaries when you delete the primary.

Thanks for that feature! Just looked at
/proc/sys/net/ipv4/conf/*/promote_secondaries
and it is the feature I was looking for. Merged in 2.6.12, if anyone 
reads this in a mail archive and wonders whether he has to upgrade.


This leads to another question: Can I manually promote a secondary 
address to become primary without deleting the primary? This would help 
me to use the new address by default during the transition period.


> What it sounds like is you need to have ssh run over SCTP instead of TCP
> to allow multi-homing. 

Maybe, but I did not find any current openssh version with sctp support. 
And with promote_secondaries, my original problem is solved perfectly.


Regards,
Carl-Daniel
-- 
http://www.hailfinger.org/
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: ip address delete bug?
@ 2005-10-05 15:32             ` Carl-Daniel Hailfinger
  0 siblings, 0 replies; 13+ messages in thread
From: Carl-Daniel Hailfinger @ 2005-10-05 15:32 UTC (permalink / raw)
  To: hadi; +Cc: lartc, netdev

jamal wrote:
> On Tue, 2005-04-10 at 23:08 +0000, Alexey Toptygin wrote:
> 
>>On Wed, 5 Oct 2005, Carl-Daniel Hailfinger wrote:
> 
> [..]
> 
>>>Normally, I would add the new IP to eth0, start another ssh to the new IP, 
>>>log out from the session to the old IP, remove the old IP from eth0 and be 
>>>done. If I want the server to be reachable under both IPs during a transition 
>>>period, I can delay deletion of the old IP until later.
>>
>>Then I guess the question is: does anything in common use depend on the 
>>old behavior?
> 
> There's a new feature in newer kernels which allows for an alias to be
> upgraded to become primary when you delete the primary. You need to
> configure the sysctl otherwise it defaults to purging all the
> secondaries when you delete the primary.

Thanks for that feature! Just looked at
/proc/sys/net/ipv4/conf/*/promote_secondaries
and it is the feature I was looking for. Merged in 2.6.12, if anyone 
reads this in a mail archive and wonders whether he has to upgrade.


This leads to another question: Can I manually promote a secondary 
address to become primary without deleting the primary? This would help 
me to use the new address by default during the transition period.


> What it sounds like is you need to have ssh run over SCTP instead of TCP
> to allow multi-homing. 

Maybe, but I did not find any current openssh version with sctp support. 
And with promote_secondaries, my original problem is solved perfectly.


Regards,
Carl-Daniel
-- 
http://www.hailfinger.org/

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2005-10-05 15:32 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-03 17:55 [LARTC] ip address delete bug? Carl-Daniel Hailfinger
2005-10-03 18:00 ` Peter Surda
2005-10-04 19:11 ` Carl-Daniel Hailfinger
2005-10-04 21:23   ` Alexey Toptygin
2005-10-04 21:23     ` Alexey Toptygin
2005-10-04 22:58     ` [LARTC] " Carl-Daniel Hailfinger
2005-10-04 22:58       ` Carl-Daniel Hailfinger
2005-10-04 23:08       ` [LARTC] " Alexey Toptygin
2005-10-04 23:08         ` Alexey Toptygin
     [not found]         ` <1128474946.6224.8.camel@localhost.localdomain>
2005-10-05 15:32           ` [LARTC] " Carl-Daniel Hailfinger
2005-10-05 15:32             ` Carl-Daniel Hailfinger
2005-10-04 23:20 ` [LARTC] " Peter Surda
2005-10-04 23:23 ` Stephen Hemminger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.