mtu 949 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/bin/sh
  2. ########################################################################
  3. # Begin $network_devices/services/mtu
  4. #
  5. # Description : Sets MTU per interface
  6. #
  7. # Authors : Nathan Coulson - nathan@linuxfromscratch.org
  8. # Jim Gifford - jim@linuxfromscratch.org
  9. #
  10. # Version : 00.00
  11. #
  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.
  15. #
  16. ########################################################################
  17. . /etc/sysconfig/rc
  18. . ${rc_functions}
  19. . ${IFCONFIG}
  20. if [ -z "${MTU}" ]
  21. then
  22. boot_mesg "MTU variable missing from ${IFCONFIG}, cannot continue." ${FAILURE}
  23. echo_failure
  24. exit 1
  25. fi
  26. case "${2}" in
  27. up)
  28. boot_mesg "Setting the MTU for ${1} to ${MTU}..."
  29. echo "${MTU}" > "/sys/class/net/${1}/mtu"
  30. evaluate_retval
  31. ;;
  32. down)
  33. ;;
  34. *)
  35. echo "Usage: ${0} [interface] {up|down}"
  36. exit 1
  37. ;;
  38. esac
  39. # End $network_devices/services/mtu