Bug#645813: interface aliases ignored in recent ifupdown
Hello, On Sun, 23 Oct 2011 16:46:49 -0600 Bob Proulx b...@proulx.com wrote: ifupdown 0.7~alpha5+really0.6.15 properly brings up both eth0 and eth0:0 when doing ifup -a, after upgrading to ifupdown 0.7~beta1, eth0:only eth0 is up. That isn't quite true. What really happens is that ifconfig isn't displaying the information to you. In order to see it you will need to use the 'ip' command from the 'iproute' package. Bob, is it okay if I unconditionally add 'label %iface%' to 'ip addr add' calls in ifupdown? Testing shows it appears to do what's intended, but please confirm if it really true. -- WBR, Andrew signature.asc Description: PGP signature
Bug#645813: interface aliases ignored in recent ifupdown
Andrew Shadura wrote: Bob, is it okay if I unconditionally add 'label %iface%' to 'ip addr add' calls in ifupdown? Testing shows it appears to do what's intended, but please confirm if it really true. I believe that is true. I believe that you should always be able to add a label to the interface when doing 'ip addr add'. And that when deleting the interface with 'ip addr del' it should always be okay (but not required) to use the same option arguments used as when it was added. If a label is provided then it must match. But I don't want to misrepresent myself. I have no special knowledge of the ip and kernel internals. I am just a long time user of them. Here I can only act as a second brain and reviewer. I think always adding a label is a good way to maintain backward compatibility with the previous behavior and the expectations from it. If a new version is made available I will be happy to test it. Bob signature.asc Description: Digital signature
Bug#645813: interface aliases ignored in recent ifupdown
Just adding the label is not enough. It will fix ifup, but ifdown is still horribly broken. ifdown still downs the whole interface do to the ip link set dev x down line, it shouldn't be called on alias interfaces, but that is beyond me at the moment. Also not sure if the tun up/down could use this code also. The debian/testbuild file needs to be modified to pass for these modifications --- ifupdown-0.7~alpha5.1ubuntu5/ifupdown.nw 2011-09-02 15:50:36.0 -0400 +++ ifupdown-0.7~alpha5.1ubuntu5a/ifupdown.nw 2011-10-24 09:23:05.40385 -0400 @@ -4377,14 +4377,14 @@ up ip addr add %address%[[/%netmask%]] [[broadcast %broadcast%]] \ - [[peer %pointopoint%]] dev %iface% + [[peer %pointopoint%]] dev %iface% label %iface% ip link set dev %iface% [[mtu %mtu%]] [[address %hwaddress%]] up [[ ip route add default via %gateway% [[metric %metric%]] dev %iface% ]] down [[ ip route del default via %gateway% [[metric %metric%]] dev %iface% 21 1/dev/null || true ]] - ip -4 addr flush dev %iface% + ip -4 addr flush dev %iface% label %iface% ip link set dev %iface% down @ -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#645813: interface aliases ignored in recent ifupdown
Patrick Domack wrote: Just adding the label is not enough. It will fix ifup, but ifdown is still horribly broken. Adding the label to both ifup and ifdown symmetrically should be enough. As you propose in your patch. ifdown still downs the whole interface do to the ip link set dev x down line, it shouldn't be called on alias interfaces, but that is beyond me at the moment. Also not sure if the tun up/down could use this code also. The debian/testbuild file needs to be modified to pass for these modifications Earlier I wrote: I believe that you should always be able to add a label to the interface when doing 'ip addr add'. And that when deleting the interface with 'ip addr del' it should always be okay (but not required) to use the same option arguments used as when it was added. If a label is provided then it must match. I wrote that poorly and confusingly. Seeing Patrick's message makes that clear. Sorry. I meant that you can down an interface without a label. If the label is provided it must match. But labels will be required on both due to the problem Patrick points out. Downing an interface without the label will down the entire interface. Therefore for any interface brought up with a label it should also be brought down with the same label to restrict the action. Bob signature.asc Description: Digital signature
Bug#645813: interface aliases ignored in recent ifupdown
This confuses me atleast. In my testing, up works fine, like it should. But ifdown of eth0 turns eth0 off cause if the set link down. The same with eth0:x, cause set link down/up doesn't support labels. If set link down was removed, it would work as expected, but I don't think overall that is what is wanted. Bob Proulx b...@proulx.com wrote: Patrick Domack wrote: Just adding the label is not enough. It will fix ifup, but ifdown is still horribly broken. Adding the label to both ifup and ifdown symmetrically should be enough. As you propose in your patch. ifdown still downs the whole interface do to the ip link set dev x down line, it shouldn't be called on alias interfaces, but that is beyond me at the moment. Also not sure if the tun up/down could use this code also. The debian/testbuild file needs to be modified to pass for these modifications Earlier I wrote: I believe that you should always be able to add a label to the interface when doing 'ip addr add'. And that when deleting the interface with 'ip addr del' it should always be okay (but not required) to use the same option arguments used as when it was added. If a label is provided then it must match. I wrote that poorly and confusingly. Seeing Patrick's message makes that clear. Sorry. I meant that you can down an interface without a label. If the label is provided it must match. But labels will be required on both due to the problem Patrick points out. Downing an interface without the label will down the entire interface. Therefore for any interface brought up with a label it should also be brought down with the same label to restrict the action. Bob
Bug#645813: interface aliases ignored in recent ifupdown
Hello, On Mon, 24 Oct 2011 15:52:04 -0400 Patrick Domack patric...@patrickdk.com wrote: This confuses me atleast. In my testing, up works fine, like it should. But ifdown of eth0 turns eth0 off cause if the set link down. The same with eth0:x, cause set link down/up doesn't support labels. If set link down was removed, it would work as expected, but I don't think overall that is what is wanted. I think ifupdown can be changed to operate on link just once, so it actually would put the link down when nothing uses it. That can solve some problems with vlans as well. -- WBR, Andrew signature.asc Description: PGP signature
Bug#645813: interface aliases ignored in recent ifupdown
found 645813 0.7~beta1 thanks Stéphane Graber wrote: Version: 0.7~alpha5.1ubuntu5 That is an unusual version number to file against Debian. :-) To tighten things up I have marked it as found against 0.7~beta1. ifupdown 0.7~alpha5+really0.6.15 properly brings up both eth0 and eth0:0 when doing ifup -a, after upgrading to ifupdown 0.7~beta1, only eth0 is up. That isn't quite true. What really happens is that ifconfig isn't displaying the information to you. In order to see it you will need to use the 'ip' command from the 'iproute' package. root@debian01:~# ifdown -a root@debian01:~# ifconfig root@debian01:~# ifup -a root@debian01:~# ifconfig eth0 Link encap:Ethernet HWaddr 8a:90:f8:95:7a:80 inet addr:192.168.122.17 Bcast:0.0.0.0 Mask:255.255.255.0 inet6 addr: fe80::8890:f8ff:fe95:7a80/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:60745 errors:0 dropped:0 overruns:0 frame:0 TX packets:46113 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:89047505 (84.9 MiB) TX bytes:3240597 (3.0 MiB) Try the experiment again and at the points where you call 'ifconfig' to display the network state please use the 'ip addr show' command to show the network state instead. It will show you more information. # ifdown -a # ip addr show # ifup -a # ip addr show In the 'ip addr show' output you should see something similar to this that I tested on my machine: 2: eth0: BROADCAST,MULTICAST,UP,LOWER_UP mtu 1500 qdisc pfifo_fast state UP qlen 1 inet 192.168.122.17/24 scope global eth0 inet 192.168.122.18/24 scope global eth0 There it can be seen that the new ip address is up and active. However no label has been assigned to it. As Nil's remarked in his message to the bug I am sure this is an issue of labeling. root@debian01:~# ifup eth0:0 ifup: interface eth0:0 already configured Because the IP address is actually up and online at that time. At this point I would like to mention a reference for aliases and labels and what is changing and why. Unfortunately I don't have a canonical reference to mention. In lieu of that I will point to the Shorewall documentation which discusses this topic in some detail. It is useful even if not canonical. http://www.shorewall.net/Shorewall_and_Aliased_Interfaces.html With the above in mind I have switched my own uses of this to the method suggested in the Shorewall documentation. Now I use the 'up' and 'down' script mechanism of ifupdown to call the 'ip' command to bring aliases up and down automatically with the underlying network device. This seems to be the new direction things have taken and it works well in practice for me. In which case you might have the following interfaces stanza to replicate your previous behavior done the other way: auto eth0 allow-hotplug eth0 iface eth0 inet static address 192.168.122.17 netmask 255.255.255.0 gateway 192.168.122.1 up addr add 192.168.122.18/24 dev eth0 label eth0:0 down addr add 192.168.122.18/24 dev eth0 label eth0:0 Hope this helps, Bob signature.asc Description: Digital signature
Bug#645813: interface aliases ignored in recent ifupdown
Bob Proulx wrote: iface eth0 inet static address 192.168.122.17 netmask 255.255.255.0 gateway 192.168.122.1 up addr add 192.168.122.18/24 dev eth0 label eth0:0 down addr add 192.168.122.18/24 dev eth0 label eth0:0 The above has a typo error. I left out the 'ip' part. It should read like this: auto eth0 allow-hotplug eth0 iface eth0 inet static address 192.168.122.17 netmask 255.255.255.0 gateway 192.168.122.1 up ip addr add 192.168.122.18/24 dev eth0 label eth0:0 down ip addr add 192.168.122.18/24 dev eth0 label eth0:0 Bob signature.asc Description: Digital signature
Bug#645813: interface aliases ignored in recent ifupdown
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Confirmed that the issue is indeed only about missing labels on the added addresses. - -- Stéphane Graber Ubuntu developer http://www.ubuntu.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQIcBAEBCgAGBQJOpKI0AAoJEMY4l01keS1nZ2UP/1XKWzIUPRiXZmDSL0XrrE8k Z9IiYZ1cF/KiYHhyW8CVSnQlmG6+gbcEQ5qOW2+ygJZhtXzhGpD4kMhYRZWAbJ1A y/Xd9K6Tzn4ghszkSwlZ8C64CyYuge0HXZVYgTVHbTg/WTG4BYfao9D4kkZGVl9h CVipUJqnrgvTHOBYQAU9br70eUX/lkqwJt098zZou55NY7REUyaNqS1z+0HTUXhO cpOMXvEsWrY4QDXsXYTZM3Jowi7Kp0l0bzeQNKBIc2Em3nI25Ssx3+Xo1Gw+Rltd zctCLSNLA5qfeSocHUKbPCPCOu6DCwn6Tp8pbo6lIw+zb0inJvSp2Q6FaCVNM4RW uGYTk4QPXxDJk786Xh8gFDXCe0j4NoY3yWxYTmp/v2KqkIfARo1llx/OuYTkDSGW 1Dzq4rB9FPuia323rhmwgQRRUji5QlkAj4zkYFOEqhRacf0oyfa09aCixTuEHMev 9dsM6Eyq0EbgjUs+LngE3HdJ/mCUwDCcuplZEuB+u0TMKRZ3+uOh2cD0F3fBElDp dELvh35imUfmSCrw7YVZ3jSUMpwtPC1tIGa+5KzSHK2k3ejZNBScJMA0afLlCI4/ wE3Vsc+lkcpgS/7p/rPcKPLUY+pa8UQ2tYhC/924TC7iJlld1DQ9/M54V1WAyyQa NjIjq4UpAIJyNQxcOm53 =zr+A -END PGP SIGNATURE- -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#645813: interface aliases ignored in recent ifupdown
Package: ifupdown Version: 0.7~alpha5.1ubuntu5 Severity: normal The following bug report was filed against Ubuntu Oneiric: https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/678425 After a bit of testing I managed to reproduce it on Debian too. Using the following /etc/network/interfaces: auto lo iface lo inet loopback auto eth0 iface eth0 inet static address 192.168.122.17 netmask 255.255.255.0 gateway 192.168.122.1 auto eth0:0 iface eth0:0 inet static address 192.168.122.18 netmask 255.255.255.0 ifupdown 0.7~alpha5+really0.6.15 properly brings up both eth0 and eth0:0 when doing ifup -a, after upgrading to ifupdown 0.7~beta1, only eth0 is up. root@debian01:~# ifdown -a root@debian01:~# ifconfig root@debian01:~# ifup -a root@debian01:~# ifconfig eth0 Link encap:Ethernet HWaddr 8a:90:f8:95:7a:80 inet addr:192.168.122.17 Bcast:0.0.0.0 Mask:255.255.255.0 inet6 addr: fe80::8890:f8ff:fe95:7a80/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:60745 errors:0 dropped:0 overruns:0 frame:0 TX packets:46113 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:89047505 (84.9 MiB) TX bytes:3240597 (3.0 MiB) loLink encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) root@debian01:~# ifup eth0:0 ifup: interface eth0:0 already configured Explicitly bringing up eth0:0 when eth0 is also considered down gives some intersting result: root@debian01:~# ifdown -a root@debian01:~# ifup eth0:0 root@debian01:~# ifconfig eth0 Link encap:Ethernet HWaddr 8a:90:f8:95:7a:80 inet addr:192.168.122.18 Bcast:0.0.0.0 Mask:255.255.255.0 inet6 addr: fe80::8890:f8ff:fe95:7a80/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:60774 errors:0 dropped:0 overruns:0 frame:0 TX packets:46120 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:89048999 (84.9 MiB) TX bytes:3241631 (3.0 MiB) root@debian01:~# ifup --version ifup version 0.7beta Copyright (c) 1999-2007 Anthony Towns This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -- System Information: Debian Release: wheezy/sid APT prefers oneiric-updates APT policy: (500, 'oneiric-updates'), (500, 'oneiric-security'), (500, 'oneiric') Architecture: amd64 (x86_64) Kernel: Linux 3.0.0-12-generic (SMP w/4 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Versions of packages ifupdown depends on: ii initscripts 2.88dsf-13.10ubuntu4 scripts for initializing and shutt ii iproute 20110315-1build1 networking and traffic control too ii libc6 2.13-20ubuntu5 Embedded GNU C Library: Shared lib ii lsb-base4.0-0ubuntu16Linux Standard Base 4.0 init scrip ii upstart [upstart-jo 1.3-0ubuntu10event-based init daemon ifupdown recommends no packages. Versions of packages ifupdown suggests: ii isc-dhcp-client [dhc 4.1.1-P1-17ubuntu10 ISC DHCP client ii net-tools1.60-23ubuntu3 The NET-3 networking toolkit ii ppp 2.4.5-5ubuntu1 Point-to-Point Protocol (PPP) - da pn rdnssd none (no description available) -- no debconf information -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org