[ -f /tmp/net.$netif.override ] && . /tmp/net.$netif.override
- if [ -n "$mtu" ] ; then
- echo ip link set $netif down
- echo ip link set $netif mtu $mtu
- echo ip link set $netif up
+ # Taken from debian dhclient-script:
+ # The 576 MTU is only used for X.25 and dialup connections
+ # where the admin wants low latency. Such a low MTU can cause
+ # problems with UDP traffic, among other things. As such,
+ # disallow MTUs from 576 and below by default, so that broken
+ # MTUs are ignored, but higher stuff is allowed (1492, 1500, etc).
+ if [ -n "$mtu" ] && [ $mtu -gt 576 ] ; then
+ echo "if ! ip link set $netif mtu $mtu ; then"
+ echo "ip link set $netif down"
+ echo "ip link set $netif mtu $mtu"
+ echo "ip link set $netif up"
echo wait_for_if_up $netif
+ echo "fi"
fi > /tmp/net.$netif.up
echo ip addr add $ip${mask:+/$mask} ${bcast:+broadcast $bcast} dev $netif >> /tmp/net.$netif.up