Last active
March 11, 2021 00:32
-
-
Save rationalsa/05844af723db8945bdea0a552ae89cf0 to your computer and use it in GitHub Desktop.
Save it in /etc/dhcp/dhclient-exit-hooks.d/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [ "$reason" = "BOUND" ] || [ "$reason" = "REBOOT" ]; then | |
ip rule del lookup "$interface" || true | |
ip route flush table "$interface" | |
ip route add default via "$new_routers" dev "$interface" table "$interface" | |
ip rule add from "$new_ip_address" lookup "$interface" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment