Oneiric's ifupdown breaks ip aliases

Bug #876829 reported by Marc Deslauriers
144
This bug affects 22 people
Affects Status Importance Assigned to Milestone
ifupdown (Debian)
Fix Released
Unknown
ifupdown (Ubuntu)
Fix Released
High
Stéphane Graber
Oneiric
Fix Released
High
Stéphane Graber
Precise
Fix Released
High
Stéphane Graber

Bug Description

Using the following /etc/network/interfaces file doesn't create the ip alias, when the same file works fine in natty and lower:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.122.201
netmask 255.255.255.0
broadcast 192.168.122.255
gateway 192.168.122.1

auto eth0:0
iface eth0:0 inet static
address 10.102.0.200
netmask 255.255.255.0
broadcast 10.102.0.255

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: ifupdown 0.7~alpha5.1ubuntu5
ProcVersionSignature: Ubuntu 3.0.0-12.20-generic 3.0.4
Uname: Linux 3.0.0-12-generic x86_64
ApportVersion: 1.23-0ubuntu3
Architecture: amd64
Date: Mon Oct 17 16:15:53 2011
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Alpha amd64 (20110302)
SourcePackage: ifupdown
UpgradeStatus: Upgraded to oneiric on 2011-08-16 (62 days ago)

Revision history for this message
Marc Deslauriers (mdeslaur) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ifupdown (Ubuntu):
status: New → Confirmed
Steve Langasek (vorlon)
Changed in ifupdown (Ubuntu):
status: Confirmed → Triaged
importance: Undecided → High
assignee: nobody → Stéphane Graber (stgraber)
Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

Running "ifup -a" post boot, doesn't bring up eth0:0 either, so it does actually look like a ifupdown bug.

Revision history for this message
Steve Beattie (sbeattie) wrote :

Yes, I'm also seeing aliased interfaces not being brought up with a configuration like so, which worked in natty and earlier:

auto eth0
iface eth0 inet static
  address 10.19.71.210
  netmask 255.255.255.0
  gateway 10.19.71.1
  ethernet-wol g

auto eth0:tmp
iface eth0:tmp inet static
  address 192.168.1.210
  netmask 255.255.255.0
  broadcast 192.168.1.255

Changed in ifupdown (Ubuntu Oneiric):
status: New → Triaged
importance: Undecided → High
assignee: nobody → Stéphane Graber (stgraber)
Revision history for this message
Stéphane Graber (stgraber) wrote :

Reproduce on Debian and forwarded.

Changed in ifupdown (Debian):
status: Unknown → New
Revision history for this message
Nils Pascal Illenseer (illenseer) wrote :

Before oneiric ifupdown used ifconfig to set the network interface and with oneiric iproute2 is used. iproute2 assigns new IPs directly to the interface, e.g. eth0, if you like to have a virtual interface eth0:0, you have to add a label explicitly.

ifconfig eth0:0 x.x.x.x up
vs.
ip addr add x.x.x.x/x dev eth0 label eth0:0

I assume ifupdown misses to set the label with iproute2.

Revision history for this message
Patrick Domack (patrickdk) wrote :

This corrects ifup, and almost corrects ifdown.

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.000000000 -0400
+++ ifupdown-0.7~alpha5.1ubuntu5a/ifupdown.nw 2011-10-24 09:23:05.403844445 -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% 2>&1 1>/dev/null || true ]]
- ip -4 addr flush dev %iface%
+ ip -4 addr flush dev %iface% label %iface%
     ip link set dev %iface% down
 @

Revision history for this message
Gareth Bult (2-gareth) wrote :

Ok, I tried this patch, improved things slightly but this package still seems heavily broken in terms of impact in the user. Anyone running aliases (I have maybe 50 servers that use aliases) who tries to upgrade to 11.10 is likely to end up with a broken server.
- is there some way we can generate a working fix for this, we're three weeks on from the report date it's an issue that can leave remote servers unreachable.

Specifically, anyone using KVM is likely to have a "br<n>" device.

It's quite common to use aliases for testing, for example "br0:test", and even with the above patch, "ifdown br0:test" will actually take down "br0" leaving the machine unreachable.

After applying the above patch, /etc/init.d/networking restart still does not bring up all aliases, however a subsequent "ifup <alias>" does .. don't know why this is the case, but it looks like more is required to make this work.

???

Revision history for this message
LStranger (andrej-rep) wrote :

I've commented about delayed boot in bug #881079 and they pointed me into this bug. Well, that's strange enough as in my case alias really is up (just as boot log says, routing table says that also, and my host is available by alias IP from local network, that's why I haven't tried to run ifconfig) but ifconfig doesn't show it but only host interface. My configuration is:

auto lo eth1 eth1:0
iface lo inet loopback
iface eth1 inet static
        address 10.11.12.1
        netmask 255.255.0.0
        gateway 10.11.12.13
iface eth1:0 inet static
        address 192.168.1.254
        netmask 255.255.255.0

Hope it can add a bit more help.

Revision history for this message
Mike Vastola (michael-vastola) wrote :

I'm experiencing the same behavior as LStranger. My IP aliases are coming up, but they're just not reflected anywhere as online (in either ifconfig or ip).

I can do the following and see the actual commands being run to bring up the interfaces, which as far as I can tell are working correctly except for the whole "showing the interfaces as up" thing.

root@server_name:~# ifdown -av && ifup -av
[ . . . ]
 ip route del default via xxx.yyy.100.1 metric 100 dev eth0 2>&1 1>/dev/null || true
ip -4 addr flush dev eth0
ip link set dev eth0 down
run-parts --verbose /etc/network/if-post-down.d
Configuring interface eth0:1=eth0:1 (inet)
run-parts --verbose /etc/network/if-down.d
run-parts: executing /etc/network/if-down.d/postfix
run-parts: executing /etc/network/if-down.d/upstart

ip -4 addr flush dev eth0:1
ip link set dev eth0:1 down
run-parts --verbose /etc/network/if-post-down.d

[ . . . ]
Configuring interface eth0=eth0 (inet)
iptables-restore < /etc/iptables.rules
run-parts --verbose /etc/network/if-pre-up.d
ip addr add xxx.yyy.100.11/255.255.255.0 broadcast xxx.yyy.100.255 dev eth0
ip link set dev eth0 up
 ip route add default via xxx.yyy.100.1 metric 100 dev eth0
[ . . . ]
Configuring interface eth0:1=eth0:1 (inet)
run-parts --verbose /etc/network/if-pre-up.d
ip addr add xxx.yyy.100.23/255.255.255.0 dev eth0:1
ip link set dev eth0:1 up
[ . . . ]

Revision history for this message
Stéphane Graber (stgraber) wrote :

Bug has been marked as fixed on Debian in ~beta2 of ifupdown 0.7.

I'll try to spend some time this week to extract the bugfix from Debian and re-apply to Ubuntu's 0.7~alpha1.

Revision history for this message
Brian Murray (brian-murray) wrote :

Bug 678425 has a bug watch for the same bug report and may be about the same issue.

Revision history for this message
Alex Bligh (ubuntu-alex-org) wrote :

We also suffer from this one. We use the perl module IO::Interface, and whereas on Lucid etc. interfaces created as specified in the bug description were listed, under Oneiric they are not, which cases lots of internal things to fail. Our current workaround is a post-up script, but that's disgusting.

Changed in ifupdown (Debian):
status: New → Fix Released
Revision history for this message
David Favor (davidfavor) wrote :

Can someone put a direct link to the fixed upstream package. I've looked and it's unclear where the real fix lives.

Thanks.

Revision history for this message
Stéphane Graber (stgraber) wrote :

The current ifupdown in Debian is believed to have the fix for this problem.

However I wouldn't recommend using it on Ubuntu as Ubuntu maintains quite a few changes on top of ifupdown so that it works with some of the Ubuntu specific changes (upstart being the biggest one of them).

I'm expecting the new ifupdown to be merged from Debian within the next few weeks, once that's done and it's been tested in Ubuntu Precise, I'll prepare an SRU for 11.10 containing just the needed fix (and any other fixes I consider important to backport).

Revision history for this message
Marcel (p-mr-l) wrote :

This fix is critical for me, having multiple server with multiple IP each,
how can I access the fix?

Revision history for this message
David Favor (davidfavor) wrote :

Great about the 11.10 merge. Thanks.

Revision history for this message
Andreas Lundberg (aztekk) wrote :

Waiting urgently ...

When can we expect a fix?

Revision history for this message
Stéphane Graber (stgraber) wrote :

It's now fixed in Precise, "just" need to extract the fix and prepare an SRU, hopefully next week.

Changed in ifupdown (Ubuntu Oneiric):
status: Triaged → Fix Released
Revision history for this message
Stéphane Graber (stgraber) wrote :

Uploaded a test package to my experimental PPA with what will end up as the SRU for Oneiric.
It's a simple cherry pick of the two upstream commits for the label bug.

It should be available in a few minutes at: https://launchpad.net/~stgraber/+archive/experimental/+packages

Changed in ifupdown (Ubuntu Precise):
status: Triaged → In Progress
Revision history for this message
Stéphane Graber (stgraber) wrote :

The package in my PPA gives the same behaviour as we currently have in Precise.

I'd appreciate it if someone affected by this bug could test the package. Thanks

Revision history for this message
Stéphane Graber (stgraber) wrote :

As a follow up to this bug, I've also filed the following bug in the Debian BTS:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=656270

I guess it's still worth backporting the current fix even though not complete and SRU the potential fix for the ifdown part when it appears in Debian and Precise.

Revision history for this message
Stéphane Graber (stgraber) wrote :

Above bug has been mostly fixed in ifupdown upstream except for ifdown eth0 bringing down eth0:0 without calling the down scripts on eth0:0.
This behaviour though isn't a regression so I won't wait for a fix for that part and will just upload the fix to Precise when it's in Ng.

I made an updated test package in my PPA and satisfied with the result, uploaded it to oneiric-proposed, expecting it to be published in a few days.

Changed in ifupdown (Ubuntu Precise):
status: In Progress → Fix Committed
Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Hello Marc, or anyone else affected,

Accepted ifupdown into oneiric-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

tags: added: verification-needed
Revision history for this message
gregg (greggatghc) wrote :

The new package in oneiric-proposed solved the problem for me.

Martin Pitt (pitti)
tags: added: verification-done
removed: verification-needed
Revision history for this message
Ross Patterson (rossp) wrote :

I found this PPA with ifupdown 0.7beta2 for oneiric and it fixed the issue for me:

https://launchpad.net/~davewalker/+archive/ifupdown

Changed in ifupdown (Ubuntu Precise):
status: Fix Committed → Fix Released
Revision history for this message
Jackson L (jlibatin) wrote :

Sorry to ask a noob question, but how do you update ifdown after enabling proposed. I did apt-get update and apt-get upgrade and nothing gets upraged. Thanks!

Revision history for this message
Marco B. (blackspiraldancer) wrote :

Had the same issue, and registered here just to say that upgrading the ifupdown package wasn't enough to solve the issue.
As a guy posted here http://ubuntuforums.org/showpost.php?p=11344530&postcount=6 the upgrade process didn't move /var/run to /run correctly. Applying the suggested workaround solved the issue (upstart not activating the static eth0 interface because can't create the directory)

Revision history for this message
Amir (amirsan) wrote :

I'm confused. I enabled oneiric-proposed archive but I couldn't find ifupdown version that is newer than what I currently have (0.7~alpha5.1ubuntu5.1) in Oneiric. Was the said new package removed from Proposed?

Revision history for this message
Stéphane Graber (stgraber) wrote :

As the package was successfully tested, it got moved from -proposed to -updates so any Oneiric user doing their regular updates (using -updates and -security) get it.

Revision history for this message
Zoltan Lippai (1-zoli) wrote :

I couldn't install from the proposed repository, but using https://launchpad.net/~davewalker/+archive/ifupdown as mentioned in #26 fixed the issue for me as well. It still gives me the error after ifup eth0:0 but it is working. Thanks!

Revision history for this message
Amir (amirsan) wrote :

ah ok no wonder I couldn't find the package in -proposed. Well i have both -updates and -security enabled but I don't get ifupdown newer than 0.7~alpha5.1ubuntu5.1 from those archives. Is that already the latest version which contain the fix/update for this bug or should I expect to get at least beta? I saw beta2ubuntu6 here http://archive.ubuntu.com/ubuntu/pool/main/i/ifupdown/ but that i believe that is for Precise

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.