R&D/hadoop-dna

Multiple NIC & same network in a single host

sunshout 2012. 2. 4. 00:45

printf “1\tuplink0\n” >> /etc/iproute2/rt_tables
printf “2\tuplink1\n” >> /etc/iproute2/rt_tables

ip route add 192.168.0.211/32 dev eth0 src 192.168.0.211 table uplink0
ip route add default via 192.168.0.1 dev eth0 table uplink0
ip rule add from 192.168.0.211/32 table uplink0
ip rule add to 192.168.0.211/32 table uplink0

ip route add 192.168.0.212/32 dev eth1 src 192.168.0.212 table uplink1
ip route add default via 192.168.0.1 dev eth1 table uplink1
ip rule add from 192.168.0.212/32 table uplink1
ip rule add to 192.168.0.212/32 table uplink1


http://kindlund.wordpress.com/2007/11/19/configuring-multiple-default-routes-in-linux/