]>
git.ipfire.org Git - people/stevee/network.git/blob - hooks/mtu
2 ########################################################################
3 # Begin $NETWORK_DEVICES/services/mtu
5 # Description : Sets MTU per interface
7 # Authors : Nathan Coulson - nathan@linuxfromscratch.org
8 # Jim Gifford - jim@linuxfromscratch.org
12 # Notes : This sets the maximum amount of bytes that can be
13 # transmitted within a packet. By default, this
14 # value is set to 1500.
16 ########################################################################
18 .
/lib
/network
/hook-header
26 echo "Usage: ${0} {pre-up|post-up|pre-down|post-down|config} [interface]"
34 echo "HOOK_NAME=$HOOK_NAME"
35 echo "HOOK_TYPE=$HOOK_TYPE"
40 mtu
=$
(cat /sys
/class
/net
/${zone}/mtu
2>/dev
/null
)
50 message
="Setting the MTU for ${zone} to ${MTU}..."
51 echo "${MTU}" > "/sys/class/net/${zone}/mtu"
52 evaluate_retval standard
57 message
="Resetting MTU for ${zone} to 1500..."
58 echo ${DEFAULT_MTU} > "/sys/class/net/${zone}/mtu"
59 evaluate_retval standard
68 cat << EOF >> ${CONFIG_ZONES}/${zone}/${HOOK_NAME}
85 # End $NETWORK_DEVICES/services/mtu