permanent settings for network interface


/ Published in: Bash
Save to your folder(s)



Copy this code and paste it in your HTML
  1. #!/bin/sh
  2. # permanent settings for network interface
  3. # http://www.cyberciti.biz/tips/howto-linux-add-ethtool-duplex-settings-permanent.html
  4. # edit file: /etc/init.d/100Mbs
  5. # sudo vi /etc/init.d/100Mbs
  6. #Append following lines:
  7.  
  8. # chmod +x /etc/init.d/100Mbs
  9. # update-rc.d 100Mbs defaults
  10. # /etc/init.d/100Mbs start
  11.  
  12. ETHTOOL="/usr/sbin/ethtool"
  13. DEV="eth0"
  14. SPEED="100 duplex full"
  15.  
  16. case "$1" in
  17. start)
  18. echo -n "Setting eth0 speed 100 duplex full...";
  19. $ETHTOOL -s $DEV speed $SPEED;
  20. echo " done.";;
  21. stop)
  22. ;;
  23. esac
  24.  
  25. exit 0

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.