Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DEBUG_FILE="/tmp/dhclient-ipstudio.debug"
- echo "Interface ${interface} entered DHCP because of $reason." >> $DEBUG_FILE
- case "$interface" in
- eth0)
- SPEED="1G"
- TABLE="1"
- ;;
- eth1)
- SPEED="1G"
- TABLE="2"
- ;;
- eth2)
- SPEED="10G"
- TABLE="3"
- ;;
- eth3)
- SPEED="10G"
- TABLE="4"
- ;;
- esac
- case "$reason" in
- BOUND|RENEW|REBIND|REBOOT|TIMEOUT)
- echo "New DHCP connection because of $reason." >> $DEBUG_FILE
- echo "dhcp for interface ${interface}" >> $DEBUG_FILE
- ip rule add from $new_ip_address table $TABLE
- ip route add default via $old_routers dev $interface table $TABLE
- if [[ "$SPEED" == "10G" ]];
- then
- ip route add 232.0.0.0/8 dev $interface
- else
- ip route add default via $old_routers dev $interface
- ip route add 224.0.0.0/4 dev $interface
- fi
- ;;
- esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement