Setting Up Your Routes

When your interface has been configured, you usually need to configure at least a default route to talk to machines external to your network.

By default, when you configure a network address for an interface, the kernel routing table contains an entry for that interface. The reason for this entry is that even though you may not be communicating to machines on another network, the kernel still needs to know where to send traffic for machines on your local network.

Let's consider the address as an example: If you want to communicate with another machine on your network with an IP address of, the kernel needs to know that traffic for the network needs to be sent through the eth0 device. This ensures that the machine can physically (through Ethernet and IP) listen for traffic that has been sent to it over the same media as the sending host's Ethernet adaptor.

The route command is used to manipulate the routing table of the Linux kernel. The most common entry is the default interface/network route we just talked about. The other very important route for external communication is the default route. The default route is used as a catchall for all IP traffic that your machine cannot reach based on its routing table.

On the machine with address, if you look at your default routing table, you can see you are able to access the network (see Listing 15-2).

Was this article helpful?

0 0

Post a comment