There also seems to be another bug for ipv6 only; the sysctl setting of
mtu happens before the ip link set dev up; which means, at up time, the
interface gets the default mtu which clobbers the ipv6 mtu.

/sbin/sysctl -q -e -w net.ipv6.conf.ens8.autoconf=0
/sbin/sysctl -q -e -w net.ipv6.conf.ens8.mtu=1480
/bin/ip link set dev ens8  up
/bin/ip -6 addr add fd0d:ffe0:5771::1:0:0/64  dev ens8 


I'm testing this post-up hook which I think covers all of the cases.

# cat /etc/network/if-up.d/mtuipv6 
#!/bin/sh

[ "$IFACE" != "lo" ] || exit 0

# Trigger only if MTU configured
[ -n "$IF_MTU" ] || exit 0

# Target ipv6 MTU settings only
[ "$ADDRFAM" = "inet6" ] || exit 0

# We need to check the underlying interface MTU and
# raise it if the IPV6 mtu is larger
CUR_DEV_MTU=$(/bin/cat /sys/class/net/$IFACE/mtu)
if [ $CUR_DEV_MTU -lt $IF_MTU ]; then
    /bin/ip link set $IFACE mtu $IF_MTU
fi
/sbin/sysctl -q -e -w net.ipv6.conf.$IFACE.mtu=$IF_MTU


Thoughts?

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1609367

Title:
  ifupdown does not set ipv6-only large mtu

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/1609367/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to