Linux Links‎ > ‎

Routing Tables

View Current route table:
ip route show [show table]

View Current rules:
ip rule show

Delete all rules:
ip rule flush

create rule:
ip rule add from $IPADDRESS table $TABLE pref $PREFNUM

create table:
Edit /etc/iproute2/rt_tables  --
for example:  create -> 
    252 NIC
    251 VPN

Add a route:
ip route add $GW via $IPADDRESS dev tun0 table $TABLE

pull an entry from the route table:
ip route show | awk 'NR==1{print $NF}'




http://lartc.org/lartc.html#LARTC.RPDB.MULTIPLE-LINKS
http://superuser.com/questions/325128/how-can-i-ensure-outbound-traffic-uses-the-same-interface-as-that-of-inbound-tra
http://kindlund.wordpress.com/2007/11/19/configuring-multiple-default-routes-in-linux/

Comments