Skip to content

Instantly share code, notes, and snippets.

@jriguera
Created February 3, 2016 15:02
Embed
What would you like to do?
Debian/Ubuntu interfaces with routing tables
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