Created
February 3, 2016 15:02
-
-
Save jriguera/e2029a760f7a6db6820c to your computer and use it in GitHub Desktop.
Debian/Ubuntu interfaces with routing tables
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
auto bond0.502 | |
# Static interface with an address, will be brought up directly on boot. | |
iface bond0.502 inet static | |
address 10.10.11.10 | |
netmask 255.255.248.0 | |
#gateway 10.10.8.1 | |
vlan-raw-device bond0 | |
post-up grep -q " live" /etc/iproute2/rt_tables || echo "202 live" >> /etc/iproute2/rt_tables | |
post-up ip rule add from 10.10.11.10 table live | |
post-up ip route add table live default via 10.10.8.1 | |
post-up ip route add table live 10.10.8.1 via 10.10.11.10 dev bond0.502 | |
post-down ip rule delete from 10.10.11.10 table live | |
post-down ip route flush table live |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment