ip address delete bug?
Subsystems (2)
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:xxI'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
Signature · 5 lines
http://www.hailfinger.org/ _______________________________________________ LARTC mailing list [email protected] http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
Quoted 1 line · On Mon, 03 Oct 2005 19:55:09 +0200 Carl-Daniel Hailfinger…
Hi,
hi
Quoted 2 lines
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.
Quoted 2 lines
Regards,
Carl-Daniel
Yours sincerely,
Peter
Signature · 5 lines
http://www.shurdix.org - Linux distribution for routers and firewalls _______________________________________________ LARTC mailing list [email protected] http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
Hi,
Quoted 9 lines · Peter Surda
Quoted 2 lines · On Mon, 03 Oct 2005 19:55:09 +0200 Carl-Daniel Hailfinger…
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?
Quoted 2 lines
Yours sincerely,
Peter
Regards,
Carl-Daniel
_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
Quoted 2 lines · Carl-Daniel Hailfinger
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?
Quoted 9 lines
"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
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
Quoted 6 lines · Alexey Toptygin
Quoted 2 lines · Carl-Daniel Hailfinger
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.
Quoted 11 lines
Quoted 9 lines
"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.
Quoted 2 lines
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.
Quoted 1 line
Alexey
Regards,
Carl-Daniel
_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
Quoted 12 lines · Carl-Daniel Hailfinger
Quoted 11 lines
Quoted 9 lines
"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?
Quoted 8 lines
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
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 11 lines · jamal
Quoted 1 line · Alexey Toptygin
On Wed, 5 Oct 2005, Carl-Daniel Hailfinger wrote:
[..]
Quoted 5 lines
Quoted 4 lines
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.
Quoted 7 lines
Quoted 2 lines
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.
Quoted 2 lines
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
Signature · 5 lines
http://www.hailfinger.org/ _______________________________________________ LARTC mailing list [email protected] http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
On Wed, 05 Oct 2005 00:58:19 +0200 Carl-Daniel Hailfinger <[email protected]> wrote:
via ssh on eth0. You delete the ip
Quoted 2 lines
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 ;-)
Quoted 2 lines
Regards,
Carl-Daniel
Yours sincerely,
Peter
Signature · 5 lines
http://www.shurdix.org - Linux distribution for routers and firewalls _______________________________________________ LARTC mailing list [email protected] http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/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
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc