Advertisement
Guest User

Untitled

a guest
Jul 14th, 2014
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. DEBUG_FILE="/tmp/dhclient-ipstudio.debug"
  2.  
  3.  
  4. echo "Interface ${interface} entered DHCP because of $reason." >> $DEBUG_FILE
  5.  
  6. case "$interface" in
  7.  
  8. eth0)
  9. SPEED="1G"
  10. TABLE="1"
  11. ;;
  12.  
  13. eth1)
  14. SPEED="1G"
  15. TABLE="2"
  16. ;;
  17.  
  18. eth2)
  19. SPEED="10G"
  20. TABLE="3"
  21. ;;
  22.  
  23. eth3)
  24. SPEED="10G"
  25. TABLE="4"
  26. ;;
  27.  
  28. esac
  29.  
  30. case "$reason" in
  31. BOUND|RENEW|REBIND|REBOOT|TIMEOUT)
  32.  
  33. echo "New DHCP connection because of $reason." >> $DEBUG_FILE
  34. echo "dhcp for interface ${interface}" >> $DEBUG_FILE
  35. ip rule add from $new_ip_address table $TABLE
  36. ip route add default via $old_routers dev $interface table $TABLE
  37.  
  38. if [[ "$SPEED" == "10G" ]];
  39. then
  40. ip route add 232.0.0.0/8 dev $interface
  41. else
  42. ip route add default via $old_routers dev $interface
  43. ip route add 224.0.0.0/4 dev $interface
  44.  
  45. fi
  46. ;;
  47. esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement