[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to configure static route?



http://kindlund.wordpress.com/2007/11/19/configuring-multiple-default-routes-in-linux/
or use interfaces file like this

 allow-hotplug eth1
 iface eth1 inet static
       address 192.168.0.2
       netmask 255.255.255.0
       network 192.168.0.0
       broadcast 192.168.0.255

post-up ip route add 192.168.0.0/24 dev eth1 src 192.168.0.2 table rt2
post-up ip route add default via 192.168.0.254 dev eth1 table rt2
post-up ip rule add from 192.168.0.0/24 table rt2
post-up ip rule add to 192.168.0.0/24 table rt2
post-up ip rule add from 10.0.0.0/24 table rt2
post-up ip rule add to 10.0.0.0/24 table rt2

the table rt2 or other name do you like is inserted in /etc/iproute2/rt_tables
like this line
1 rt2


Reply to: