blob: 5a7de080ed97920eeadad2034d699189abfc0337 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
#!/bin/sh
########################################################################
# Begin $network_devices/services/mtu
#
# Description : Sets MTU per interface
#
# Authors : Nathan Coulson - nathan@linuxfromscratch.org
# Jim Gifford - jim@linuxfromscratch.org
#
# Version : 00.00
#
# Notes : This sets the maximum amount of bytes that can be
# transmitted within a packet. By default, this
# value is set to 1500.
#
########################################################################
. /etc/sysconfig/rc
. ${rc_functions}
. ${IFCONFIG}
if [ -z "${MTU}" ]
then
boot_mesg "MTU variable missing from ${IFCONFIG}, cannot continue." ${FAILURE}
echo_failure
exit 1
fi
case "${2}" in
up)
boot_mesg "Setting the MTU for ${1} to ${MTU}..."
echo "${MTU}" > "/sys/class/net/${1}/mtu"
evaluate_retval
;;
down)
;;
*)
echo "Usage: ${0} [interface] {up|down}"
exit 1
;;
esac
# End $network_devices/services/mtu
|