]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - src/initscripts/networking/any
networking: Set configured MTU to all network zones
[people/pmueller/ipfire-2.x.git] / src / initscripts / networking / any
index 5609a9efe93271262fcd68561a2e94280a5c65bd..8d230095057e2a0ffe07b4f2129bd03556ab1e0f 100644 (file)
@@ -26,6 +26,7 @@ if [ "$(basename $0)" == "green" ]; then
        NETADDRESS="${GREEN_NETADDRESS}"
        NETMASK="${GREEN_NETMASK}"
        DEVICE="${GREEN_DEV}"
+       MTU="${GREEN_MTU}"
 elif [ "$(basename $0)" == "blue" ]; then
        DEVICE="${BLUE_DEV}"
        ADDRESS="${BLUE_ADDRESS}"
@@ -33,6 +34,7 @@ elif [ "$(basename $0)" == "blue" ]; then
        NETADDRESS="${BLUE_NETADDRESS}"
        NETMASK="${BLUE_NETMASK}"
        DEVICE="${BLUE_DEV}"
+       MTU="${GREEN_MTU}"
 elif [ "$(basename $0)" == "orange" ]; then
        DEVICE="${ORANGE_DEV}"
        ADDRESS="${ORANGE_ADDRESS}"
@@ -40,6 +42,7 @@ elif [ "$(basename $0)" == "orange" ]; then
        NETADDRESS="${ORANGE_NETADDRESS}"
        NETMASK="${ORANGE_NETMASK}"
        DEVICE="${ORANGE_DEV}"
+       MTU="${ORANGE_MTU}"
 fi
 
 if [ -z "${BROADCAST}" ]; then
@@ -77,6 +80,14 @@ case "${1}" in
                        exit 1
                fi
 
+               # Set the MTU
+               if [ -n "${MTU}" ]; then
+                       if ! ip link set dev "${DEVICE}" mtu "${MTU}" &>/dev/null; then
+                               boot_mesg "Could not set MTU of ${MTU} to ${DEVICE}..."
+                               echo_warning
+                       fi
+               fi
+
                # Create & Enable vnstat data collection
                /usr/bin/vnstat -u -i ${DEVICE} -r --enable --force > /dev/null 2>&1