After reading the linuxjournal article, I want to set up source based routing.
Why there is "Network is unreachable" error?
# ifconfig
eth0 Link encap:Ethernet HWaddr 00:00:50:1A:CE:8D
inet addr:172.20.11.242 Bcast:172.20.11.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1916 errors:0 dropped:0 overruns:0 frame:1
TX packets:381 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:220079 (214.9 Kb) TX bytes:52506 (51.2 Kb)
Interrupt:16 Base address:0x6000
eth1 Link encap:Ethernet HWaddr 00:00:50:1A:CE:8E
inet addr:172.20.11.199 Bcast:172.20.11.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1066 errors:0 dropped:0 overruns:0 frame:1
TX packets:504 errors:0 dropped:0 overruns:0 carrier:0
collisions:2 txqueuelen:100
RX bytes:117390 (114.6 Kb) TX bytes:66184 (64.6 Kb)
Interrupt:17 Base address:0x8000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
# ip route show
172.20.11.0/24 dev eth1 scope link
127.0.0.0/8 dev lo scope link
default via 172.20.11.10 dev eth0
# ip route add default via 172.20.11.10 dev eth0 tab 1
RTNETLINK answers: Network is unreachable
# ping 172.20.11.10
PING 172.20.11.10 (172.20.11.10) from 172.20.11.199 : 56(84) bytes of data.
64 bytes from 172.20.11.10: icmp_seq=0 ttl=255 time=1.005 msec
64 bytes from 172.20.11.10: icmp_seq=1 ttl=255 time=466 usec