ifup activates wrong interfaces

Bug #1295371 reported by Eduardo Damato
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
vlan (Ubuntu)
Fix Released
High
Stéphane Graber

Bug Description

When using ifup to activate one vlan interface defined in /etc/network/interfaces, ifup brings up all the vlan interfaces even if ifup -a was not issued. This is trivial to reproduce. Expectation is that ifup ethX.Y will only bring up ethX.Y and not ethX.Z as well.

1- Started with the following in /etc/network/interfaces:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto eth0.101
iface eth0.101 inet static
        address 192.168.200.2
        netmask 255.255.255.0

2- Added more vlans to the file

auto eth0.102
iface eth0.102 inet static
        address 192.168.201.2
        netmask 255.255.255.0

auto eth0.103
iface eth0.103 inet static
        address 192.168.202.2
        netmask 255.255.255.0

auto eth0.104
iface eth0.104 inet static
        address 192.168.203.2
        netmask 255.255.255.0

3- Upped only eth0.102

root@dixie:~# ifup eth0.102
Set name-type for VLAN subsystem. Should be visible in /proc/net/vlan/config
Added VLAN with VID == 102 to IF -:eth0:-
 * Setting up iSCSI targets
   ...done.
ssh stop/waiting
ssh start/running, process 2224

4- Then when upping the other interfaces obtained error that they were already up:

root@dixie:~# ifup eth0.103
ifup: interface eth0.103 already configured
root@dixie:~# vi /etc/network/interfaces
root@dixie:~# ifup eth0.103
ifup: interface eth0.103 already configured
root@dixie:~# ifup eth0.104
ifup: interface eth0.104 already configured

5- klog shows they were added all on the same second:

Mar 20 20:45:56 dixie kernel: [12270.182797] eth0.103: no IPv6 routers present
Mar 20 20:45:56 dixie kernel: [12270.742537] eth0.102: no IPv6 routers present
Mar 20 20:45:56 dixie kernel: [12270.798510] eth0.104: no IPv6 routers present

6- Added more interfaces to the interfaces file:

auto eth0.105
iface eth0.105 inet static
        address 192.168.205.2
        netmask 255.255.255.0

auto eth0.106
iface eth0.106 inet static
        address 192.168.206.2
        netmask 255.255.255.0

auto eth0.107
iface eth0.107 inet static
        address 192.168.207.2
        netmask 255.255.255.0

7- Upped only eth0.105, but eth0.106 and eth0.107 also come up:

root@dixie:~# ifup eth0.105
Set name-type for VLAN subsystem. Should be visible in /proc/net/vlan/config
Added VLAN with VID == 105 to IF -:eth0:-
 * Setting up iSCSI targets
   ...done.
ssh stop/waiting
ssh start/running, process 2619

root@dixie:~#
Mar 20 20:52:14 dixie ntpdate[2574]: step time server 91.189.89.199 offset -0.009063 sec
Mar 20 20:52:16 dixie kernel: [12650.777148] eth0.105: no IPv6 routers present
Mar 20 20:52:16 dixie kernel: [12650.809124] eth0.106: no IPv6 routers present
Mar 20 20:52:17 dixie kernel: [12651.336879] eth0.107: no IPv6 routers present

8- Sys info:

root@dixie:~# apt-cache policy ifupdown
ifupdown:
  Installed: 0.7~beta2ubuntu10
  Candidate: 0.7~beta2ubuntu10
  Version table:
 *** 0.7~beta2ubuntu10 0
        500 http://archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     0.7~beta2ubuntu8 0
        500 http://archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
root@dixie:~# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04.3 LTS"

9- messages:

root@dixie:~# for file in /var/log/upstart/network-interface-eth0.10*; do echo "--- $file"; cat $file; done
--- /var/log/upstart/network-interface-eth0.101.log
ifup: interface eth0.101 already configured
--- /var/log/upstart/network-interface-eth0.102.log
ifup: interface eth0.102 already configured
--- /var/log/upstart/network-interface-eth0.103.log
Set name-type for VLAN subsystem. Should be visible in /proc/net/vlan/config
 * Setting up iSCSI targets
   ...done.
ssh stop/waiting
ssh start/running, process 2438
--- /var/log/upstart/network-interface-eth0.104.log
Set name-type for VLAN subsystem. Should be visible in /proc/net/vlan/config
 * Setting up iSCSI targets
   ...done.
--- /var/log/upstart/network-interface-eth0.105.log
ifup: interface eth0.105 already configured
--- /var/log/upstart/network-interface-eth0.106.log
Set name-type for VLAN subsystem. Should be visible in /proc/net/vlan/config
 * Setting up iSCSI targets
   ...done.
ssh stop/waiting
ssh start/running, process 2932
--- /var/log/upstart/network-interface-eth0.107.log
Set name-type for VLAN subsystem. Should be visible in /proc/net/vlan/config
 * Setting up iSCSI targets
   ...done.

affects: ifupdown (Ubuntu) → vlan (Ubuntu)
Revision history for this message
Stéphane Graber (stgraber) wrote :

So the problem here is with the udev hook which is meant to create all the vlans when the parent interface shows up. It seems to be slightly over-enthusiastic and will try to bring up all VLANs every time any interface changes.

Revision history for this message
Eduardo Damato (edamato) wrote :

Not that it matters, but just to make it clear that it's not just related to 'static' addresses. If the vlan interfaces are set to dhcp, ifup eth0.101 will cause dhcp on all of them.

Mar 20 21:33:15 dixie dhcpd: DHCPREQUEST for 192.168.203.100 from f0:92:1c:10:0f:f0 (hertz) via eth0.104
Mar 20 21:33:15 dixie dhcpd: DHCPACK on 192.168.203.100 to f0:92:1c:10:0f:f0 (hertz) via eth0.104
Mar 20 21:33:43 dixie dhcpd: DHCPREQUEST for 192.168.200.100 from f0:92:1c:10:0f:f0 (hertz) via eth0.101
Mar 20 21:33:43 dixie dhcpd: DHCPACK on 192.168.200.100 to f0:92:1c:10:0f:f0 (hertz) via eth0.101
Mar 20 21:34:14 dixie dhcpd: DHCPREQUEST for 192.168.201.100 from f0:92:1c:10:0f:f0 (hertz) via eth0.102
Mar 20 21:34:14 dixie dhcpd: DHCPACK on 192.168.201.100 to f0:92:1c:10:0f:f0 (hertz) via eth0.102
Mar 20 21:34:29 dixie dhcpd: DHCPREQUEST for 192.168.202.100 from f0:92:1c:10:0f:f0 (hertz) via eth0.103
Mar 20 21:34:29 dixie dhcpd: DHCPACK on 192.168.202.100 to f0:92:1c:10:0f:f0 (hertz) via eth0.103

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

Test package available in ppa:stgraber/experimental

Changed in vlan (Ubuntu):
status: New → Fix Committed
importance: Undecided → High
assignee: nobody → Stéphane Graber (stgraber)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package vlan - 1.9-3ubuntu10

---------------
vlan (1.9-3ubuntu10) trusty; urgency=medium

  * Only create VLANs for the interface we are processing. (LP: #1295371)
 -- Stephane Graber <email address hidden> Thu, 20 Mar 2014 17:48:43 -0400

Changed in vlan (Ubuntu):
status: Fix Committed → Fix Released
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.