I have two rules in my routing tables. The default route, which is to the gateway, and a second route which forwards everything in the network segment to * or to no gateway. Is this second rule necessary so that local packets do not by default go to the router first, or is the nic smart enough to check its own settings and see that if a packet is sending is in it's network segment, not to send it to the gateway?
|
In general, you will see two rules (at least) in your routing table on most flavors of *nix. You'll have a route to your local network (for this example, 10.11.12.0/24):
And one identifying your default route.
So, what this effectively tells your kernel, is: send any packets going to send any packets to any address other than the local network (0.0.0.0 matches anything) to the gateway (10.11.12.1) (flags: U = route is Up, G = gateway). If you have more interfaces, or you are multi-homed, or if you have specific network or host routes configured, you may see more routes than that, but this is sort of the minimum that you'd see on a regular basis. By configuring and bringing up the interface, the kernel will automatically create that local network route. You don't need to manually add that route. |
|||||||
|