July 7, 2009

Kernel Routing Table - Interface specific routes

I have a question on kernel routing table. It will be great if any of you can throw some light on this topic

In general, whenever an inteface is brought to 'up' state, an interface route comes up. for ex. If eth0 with Ip address is brought up, the following route is created by default
" U 0 0 0 eth0"
After this route is created, if i try to add the same route manually, with the following command, the same route gets added again.
"route add -net netmask dev eth0"
I do not see any difference in both of these routes when i verified with 'route -n' or 'netstat -r' or 'cat /proc/net/route'. How is this possible?
In general, at any point of time, you cannot have two same entries in the kernel routing table. Can any of the linux expert help me with this question??


Click Here!