#132 Issue closed: MTU not applied to interfaces

Labels: enhancement

jezzaaa opened issue at 2012-07-26 02:38:

My backup service runs over a network that supports jumbo frames (MTU 9000). I had to manually configure this before doing a restore. Here's a patch to capture the MTU within the network setup script, which worked for me.

--- usr/share/rear/rescue/GNU/Linux/31_network_devices.sh.dist  2012-07-26 09:43:26.000000000 +1000
+++ usr/share/rear/rescue/GNU/Linux/31_network_devices.sh       2012-07-26 10:06:24.000000000 +1000
@@ -113,6 +113,10 @@
                done
                echo "ip link set dev $dev up" >>$netscript
        fi
+
+       mtu="$(cat $sysfspath/mtu)"
+       BugIfError "Could not read a MTU address from '$sysfspath/mtu'!"
+       echo "ip link set dev $dev mtu $mtu" >>$netscript
 done # for dev in /sys/class/net/*

 # the following is only used for bonding setups

jhoekx commented at 2012-07-26 10:57:

Can you submit this in a pull request so you will get proper credit?

One thing I would change is test for the existence of $sysfspath/mtu instead of using BugIfError. It is not critical to have mtu information for most users.

jezzaaa commented at 2012-07-27 03:16:

So, "pull request" being something to do with github? I'll have to work out how to do this.

Agree with possible missing mtu file. If it DOES exist, but mtu is empty, something is fishy, so I reckon I still PrintIfError in that case. Something like this perhaps:

if test -e $sysfspath/mtu ; then
    mtu="$(cat $sysfspath/mtu)"
    PrintIfError "could not read a MTU address from '$sysfspath/mtu'!"
    [[ "$mtu" ]] && echo "ip link set dev $dev mtu $mtu" >> $netscript
fi

jezzaaa commented at 2012-07-27 04:44:

Pull request #138 added.


[Export of Github issue for rear/rear.]