[Bug 1224007] Re: mtu not always set properly on bond/vlan interface
Dan Streetman
dan.streetman+launchpad at canonical.com
Thu Sep 8 03:01:49 UTC 2016
I should note that this is marked as Fix Released in debian, but from
the debian bug comments it just looks like Chris asked for that bug to
be closed as a configuration issue (which this is not).
This is actually only a VLAN issue with higher-than-default mtu. The
bond does not have anything to do with the problem. The problem is the
vlan package (required for ifupdown vlan support) installs a udev rule
that triggers for each new interface; it checks the ifupdown
configuration, and creates any corresponding vlan interfaces. The real
interface and all its vlan interfaces then race to finish udev
processing and notify upstart, which then calls ifup directly on each
interface. If upstart calls ifup for the vlan before the actual
interface (and the vlan has a high mtu), it will fail while being
brought up.
I think this can be fixed in a similar way to bug 1609367, where the
problem is higher-than-default mtu on ipv6 (i.e. inet6 section);
although in an easier way, since ifupdown already requires the 'vlan'
package for vlan support, and that package provides an if-pre-up script
already.
If we edit the /etc/network/if-pre-up.d/vlan script (from the vlan
package) like below (for trusty, similar patch for x and y), it will
increase the raw device's mtu if needed.
--- vlan.orig 2016-09-08 02:12:55.901172000 +0000
+++ vlan 2016-09-08 02:10:49.213172000 +0000
@@ -51,7 +51,14 @@
echo "$IF_VLAN_RAW_DEVICE does not exist, unable to create $IFACE"
exit 1
fi
- ip link set up dev $IF_VLAN_RAW_DEVICE
+ if [ -n "$IF_MTU" ]; then
+ CUR_DEV_MTU=`cat /sys/class/net/$IF_VLAN_RAW_DEVICE/mtu`
+ # increase the vlan raw device mtu if needed
+ if [ -n "$CUR_DEV_MTU" ] && [ $CUR_DEV_MTU -lt $IF_MTU ]; then
+ MTU_PARAM="mtu $IF_MTU"
+ fi
+ fi
+ ip link set up dev $IF_VLAN_RAW_DEVICE $MTU_PARAM
vconfig add $IF_VLAN_RAW_DEVICE $VLANID
fi
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to ifupdown in Ubuntu.
https://bugs.launchpad.net/bugs/1224007
Title:
mtu not always set properly on bond/vlan interface
Status in ifupdown package in Ubuntu:
Confirmed
Status in vlan package in Ubuntu:
New
Status in ifupdown package in Debian:
Fix Released
Bug description:
* Description
When configuring a network with bonding+vlan and setting the MTU,
occasionally the MTU doesn't get set properly on the vlan interface.
In addition if one checks /var/log/upstart/networking.log whenever there is a failure the following message is printed:
SIOCSIFMTU: Numerical result out of range
I've tested the latest ifupdown package (0.7.44) and the problem still exists.
Multi/single CPU settings both exhibit the issue.
* Versions
This affects latest ifupdown and ubuntu p/q/r/s.
* Test Case
# Create a p/q/r/s server vm with two network interfaces
# This is reproducible on real hardware as well
# Install the following
sudo apt-get install vlan ifenslave-2.6 bridge-utils
sudo modprobe bonding 8021q
# Edit the interfaces file
/etc/networking/interfaces:
auto bond0
iface bond0 inet manual
bond-mode 802.3ad
bond-miimon 100
bond-lacp-rate 1
bond-slaves eth0 eth1
post-up ifconfig bond0 mtu 9000
auto eth0
iface eth0 inet manual
bond-master bond0
post-up ifconfig eth0 mtu 9000
auto eth1
iface eth1 inet manual
bond-master bond0
post-up ifconfig eth1 mtu 9000
auto bond0.123
iface bond0.123 inet static
address 192.168.122.68
netmask 255.255.255.0
gateway 192.168.122.1
post-up ifconfig bond0.123 mtu 9000
# edit rc.local (or another startup script) so we reboot until we hit the error
/etc/rc.local:
DEVS="eth0 eth1 bond0 bond0.123"
for d in $DEVS; do
mtu=$(cat /sys/class/net/$d/mtu)
if [ $mtu != 9000 ]; then
echo "FAIL"
exit 1
fi
done
reboot
exit 0
# Now reboot the machine, within 10m or so you should be at the login prompt
# if you ifconfig | grep MTU you will see some of our interfaces did not get
# the MTU properly set and the test failed.
# Essentially we want to ensure that all MTU's (except lo) were set to 9000
* Workaround
Change the bond0.123 post-up command to:
post-up sleep 2 && ifconfig bond0.123 mtu 9000
Now when rebooting the interfaces will all be brought up with the
proper MTU.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/1224007/+subscriptions
More information about the foundations-bugs
mailing list