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?

1 Answer 1


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,   U         0 0          0 eth0

And one identifying your default route.         UG        0 0          0 eth0

So, what this effectively tells your kernel, is:

send any packets going to out eth0, directly, without specifically sending them to the default router (flags: U = route is UP)

send any packets to any address other than the local network ( matches anything) to the gateway ( (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.

  • 1
    does the for local network mean send to "no one" or basically the any address already specified by the packet?
    – rubixibuc
    Dec 29, 2011 at 1:55
  • 2
    the in netstat, or * in the output of route -e just means that there is no gateway set for that route, and that packets are just routed out a particular interface. you will only see that with directly connected networks. Dec 29, 2011 at 6:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .