net_run 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. koko -d ous,veth0,172.17.31.2/16 -d relay,veth1,172.17.31.100/24 || exit 1
  2. docker exec --privileged -u root ous ethtool -K veth0 tx off tso off ufo off
  3. docker exec --privileged -u root relay ethtool -K eth0 tso off gro off gso off
  4. docker exec --privileged -u root relay ethtool -K veth1 tso off gro off gso off
  5. docker exec --privileged -u root relay ifconfig eth0 mtu 9000
  6. docker exec --privileged -u root relay ifconfig veth1 mtu 9000
  7. docker exec --privileged -u root ous ifconfig veth0 mtu 9000
  8. docker exec --privileged -u root ous route del default gw 172.18.0.1
  9. docker exec --privileged -u root ous route add default gw 172.17.0.1
  10. docker exec --privileged -u root relay bash -c "echo 0 > /proc/sys/net/ipv4/ip_forward"
  11. #Check to see whether hosts's docker interface has turned off off-loading
  12. tso=$(ethtool -k docker0 | grep tcp-segmentation-offload | awk -F': ' '{ print $2}')
  13. gso=$(ethtool -k docker0 | grep generic-segmentation-offload | awk -F': ' '{ print $2}')
  14. gro=$(ethtool -k docker0 | grep generic-receive-offload | awk -F': ' '{ print $2}')
  15. if [ $tso == on ] || [ $gso == on ] || [ $gro == on ]; then
  16. echo "Please run the following commands:"
  17. fi
  18. if [ $tso == on ]; then
  19. echo "ethtool -K docker0 tso off"
  20. fi
  21. if [ $gso == on ]; then
  22. echo "ethtool -K docker0 gso off"
  23. fi
  24. if [ $gro == on ]; then
  25. echo "ethtool -K docker0 gro off"
  26. fi