Guest User

Untitled

a guest
Jan 9th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. #!/bin/bash
  2. if [ -n "$1" ]; then
  3. /sbin/ethtool -G $1 rx 4096 tx 4096
  4. /sbin/ethtool -K $1 tso on gso on
  5. fi
  6.  
  7. #!/bin/bash
  8. case "$1" in
  9. eth0)
  10. /sbin/ethtool -G $1 rx 16384 tx 16384
  11. /sbin/ethtool -K $1 gso on gro on
  12. ;;
  13. eth1)
  14. /sbin/ethtool -G $1 rx 64 tx 64
  15. /sbin/ethtool -K $1 tso on gso on
  16. /sbin/ip link set $1 txqueuelen 0
  17. ;;
  18. esac
  19. exit 0
  20.  
  21. #!/bin/bash
  22.  
  23. if [ -n "$1" ]
  24. then
  25. IFACE="$1"
  26.  
  27. # If interface is physical
  28. if [[ $IFACE =~ ^eth[0-9]+$ ]]
  29. then
  30. # Do whatever you need for a physical interface here
  31. # example below
  32. /sbin/ethtool -K $IFACE rx off
  33.  
  34. # Else if it's a bond
  35. elif [[ $IFACE =~ ^bond[0-9]+$ ]]
  36. then
  37. # Do whatever you need for the bond here
  38. # example below
  39. /sbin/ethtool -K $IFACE gso off
  40.  
  41. # Now deal with slaves
  42. # Pull out slave interface names from /proc/net/bonding/bondX
  43. SLAVES=$(/bin/grep -oP "Slave Interface: K(eth[0-9]+)" /proc/net/bonding/$IFACE)
  44. for SLAVE in $SLAVES
  45. do
  46. # Do whatever you need with the slave here
  47. # example below
  48. /sbin/ethtool -K $SLAVE tso off gso off
  49. done
  50. fi
  51. fi
  52.  
  53. auto eth0
  54. iface eth0 inet static
  55. pre-up /sbin/ethtool -s eth0 speed 10 duplex full
  56.  
  57. systemctl enable NetworkManager-dispatcher
  58.  
  59. systemctl enable NetworkManager-dispatcher
  60.  
  61. Active: inactive (dead)
  62.  
  63. #!/bin/bash
  64. if [ "$1" = "eth0" && "$2" = "up" ]; then
  65. /sbin/ethtool --offload eth0 tso off
  66. fi
Add Comment
Please, Sign In to add comment