vlan on top of untagged network won't start
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ifupdown (Ubuntu) |
New
|
Undecided
|
Unassigned | ||
vlan (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Due to an upgrade (of probably of the ifupdown or vlan package), this specific network configuration no longer comes up automatically:
1) Two or more network interfaces bonded
2) An untagged network configured on that bond
3) A vlan on top of that untagged network
What does come up automatically:
1) A single (e.g. unbonded) network interface with an untagged network configured and a vlan on top of that network
2) Two or more network interfaces bonded with a vlan on top of that untagged bond
An exact example of the configuration that doesn't work is provided below. It fails to come up correctly, both during boot and manually. The problem seems to be a blocking dependency loop between the bond and the vlan.
As recommended in https:/
Perhaps related to LP bug 1573272 or bug 1636708 ?
=======
Interface configuration
=======
auto eno1
iface eno1 inet manual
mtu 1500
bond-master bond1
bond-primary eno1
auto eno2
iface eno2 inet manual
mtu 1500
bond-master bond1
auto bond1
iface bond1 inet static
mtu 1500
address 10.10.10.3
bond-miimon 100
bond-mode active-backup
bond-slaves none
bond-downdelay 0
bond-updelay 0
dns-nameservers 10.10.10.1
gateway 10.10.10.1
netmask 255.255.0.0
auto bond1.2
iface bond1.2 inet static
mtu 1500
address 10.11.10.3
netmask 255.255.0.0
vlan-raw-device bond1
=======
When bringing up the bond
=======
# ifup bond1 &
Waiting for a slave to join bond1 (will timeout after 60s)
# ps afx
(...)
ifup bond1
\_ /bin/sh -c /bin/run-parts --exit-on-error /etc/network/
\_ /bin/run-parts --exit-on-error /etc/network/
\_ /bin/sh /etc/network/
(...)
/lib/systemd/
\_ /lib/systemd/
\_ /bin/sh /lib/udev/
\_ /bin/sh /etc/network/
\_ ifup bond1
(...)
==> After waiting 60 seconds:
# ip link | grep -E 'eno[1|2]|bond1*'
eno1: <BROADCAST,
eno2: <BROADCAST,
bond1: <NO-CARRIER,
bond1.2@bond1: <NO-CARRIER,
=======
When bringing up a slave
=======
# ifup eno1
Waiting for bond master bond1 to be ready
# ps afx
(...)
/lib/systemd/
\_ /lib/systemd/
\_ /bin/sh /lib/udev/
\_ /bin/sh /etc/network/
\_ ifup bond1
\_ /bin/sh -c /bin/run-parts --exit-on-error /etc/network/
(...)
# ip link | grep -E 'eno[1|2]|bond1*'
eno1: <BROADCAST,
eno2: <BROADCAST,
bond1: <BROADCAST,
=======
Only workaround that works
=======
# ifup eno1
Waiting for bond master bond1 to be ready
# kill $(ps -ef | grep 'ifup bond1' | sed -n 2p | awk '{ print $2}')
# ifup eno2
# ip link | grep -E 'eno[1|2]|bond1*'
eno1: <BROADCAST,
eno2: <BROADCAST,
bond1: <BROADCAST,
bond1.2@bond1: <BROADCAST,
tags: | added: ifupdown |
tags: | added: vlan xenial |
tags: | added: bonding |
Been doing some troubleshooting and we think we've found the fix for this issue:
The script /etc/network/ if-pre- up.d/vlan contains the following section of code starting at line 62:
if [ ! -e "/sys/class/ net/$IFACE" ]; then
# Try ifup for the raw device, if it fails then bring it up directly
# this is required e.g. there is no configuration for the raw device
ifup $IF_VLAN_RAW_DEVICE || ip link set up dev $IF_VLAN_RAW_DEVICE
vconfig add $IF_VLAN_RAW_DEVICE $VLANID
fi
In this case it's trying to bring up a raw device that has already been brought up, causing it to wait forever for the lock on the raw interface to be released. It is however lacking a check on the status of the raw interface, which it shouldn't have to bring up if it already exists. So this problem goes away when we put an if-statement around that section of the code:
if [ ! -e "/sys/class/ net/$IFACE" ]; then net/$IF_ VLAN_RAW_ DEVICE/ operstate 2> /dev/null | grep -q "up"`; then
if ! `cat /sys/class/
# Try ifup for the raw device, if it fails then bring it up directly
# this is required e.g. there is no configuration for the raw device
ifup $IF_VLAN_RAW_DEVICE || ip link set up dev $IF_VLAN_RAW_DEVICE
fi
vconfig add $IF_VLAN_RAW_DEVICE $VLANID
fi
It seems to work perfectly, tested on these cases:
1) a vlan on top of a single enp0sX interface without untagged network configuration
2) a vlan on top of a single enp0sX interface with its own untagged network configuration
3) a vlan on top of a bond of two enp0sX interfaces, without the bond having its own untagged network configuration
4) a vlan on top of a bond of two enp0sX interfaces, with the bond having its own untagged network configuration