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
if ! `cat /sys/class/net/$IF_VLAN_RAW_DEVICE/operstate 2> /dev/null | grep -q "up"`; 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
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
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