Guide to routed

The routed that comes with Linux kernel series 2.2.x by default—though it is not usually installed by default—only handles unicast IPv4. If you intend to use RIP within an IPv4 context, this is the only version you’ll need. Be aware that in this tool’s own manual under the BUGS section, it says the following: “routed is of dubious value. Consider using gated (8) or zebra (8).” As usual, it’s a matter of choosing the right tool for the job. Sometimes routed is all you need.

How routed Works

The routed routing daemon typically starts at boot time—you’ll want to be sure that it is set up to do so on the Linux box you use for your router. After finding out which network interfaces are active, the router looks at how many interfaces it has to deal with. If there is more than one, routed determines that it will have to deal with multiple internal networks rather than the single internal network that only one interface requires.

At this point, routed looks to each of the interfaces to see what types of packets they support. In this case, the only two packet types of consequence are unicast and broadcast. If the interface can only handle unicast data, the router sends a request packet out through it to the machines defined in its /etc/hosts file. Broadcast packets are the preferred solution, however. If the interface can handle a broadcast packet, the request packet goes as a broadcast message—which means that it goes to the network’s broadcast IP address, and all machines capable of receiving broadcast traffic pick it up.

After the requests are sent, routed enters a listening loop. At this point the daemon is receptive to two types of packets: request and response. A request packet tells routed to build a list of its routing table contents with the following information for each route:

  • The network or host IP address to which this table entry refers.

  • The netmask for this network.

  • The RIP cost (see Chapter 1, “Unicast Protocols,” for more information) to send data along this particular route.

After the list is completed, it is returned to the machine that sent the request in the form of a response packet.

When routed receives a response packet from another machine, however, it has to do a bit of thinking before it knows what to do with the information. Figure 5.1 illustrates the decision-making process involved.

Figure 5.1. A flow chart illustrating how routed analyzes a response packet.


In the meantime, every 30 seconds routed has been sending out copies of its routing tables, according to the unicast/broadcast issues discussed earlier in this section. All of the other routed routers within your network, if you have more than one, have been doing the same.Whenever one of these packets arrives, its contents overwrite their counterparts’ in the current table because they are considered definitive. This means that if any of the network or host entries in routed’s table do not match what just arrived, it is replaced with the new entry. Brand new routes are added also at this point if they don’t already exist.When data is changed in this manner, its last change time is reset to zero.

If any table entry’s last change time advances to 180 seconds, routed sets the cost for the route to sixteen—which you might remember invalidates the route in RIP—and flags it for deletion. This entry is not actually removed until it has been flagged in this manner for another 60 seconds, which corresponds to two sends of the router’s routing tables to its neighbors. After these 60 seconds, if no new response packets give information that this route is up and active, it is deleted from this router’s tables. The router then must choose another valid route from itself to the specified destination from those available.

Configuring routed

The routed RIP routing daemon builds its own routing tables utilizing the method described in the earlier section,“How routed Works,” so you do not need to start it with a list of defaults. There is a file that you can create, however, if you have some gateways that need to be defined as active or passive. An active gateway is able to respond to routing queries; a passive one is not. That is the “simple” difference between the two.

Given that a passive router is not going to respond to request packets, routed will never learn of it if it is not explicitly told. To enter this information, first create the file /etc/gateways as root.You then must add a line for each passive gateway in the format:

address name gateway cost passive 

All but the last item in this line of code must be replaced with the appropriate values:

  • address. The IP address of the host or network this entry refers to.

  • name. The hostname as set in /etc/hosts, the network name as set in /etc/ networks, or the full name for the machine in the format host.domain.extension.

  • gateway. The name or IP address for the gateway that traffic must pass through to get to address.

  • cost. The RIP cost of going through this gateway, determined according to the rules discussed in Chapter 1.

Passive gateway information is loaded at boot time—when routed starts. It is not reloaded unless you restart the routing daemon.

Running routed

The routed daemon, as mentioned earlier, should be set to start at boot time. You do this either through a file, such as rc.local, or by adding an initialization script pointer for the run levels that require the routing daemon. In either case, there are flags available so you can specify particulars about how this program should run. Table 5.1 lists the options and their functions.

Table 5.1. Flags and Options Available for the IPv4 Version of routed
Option Result
-d Saves extensive debugging information.
-g Sets a default route, such as –g 192.168.52.1.Typically used to point to external destinations that routed may not be able to find on its own, such as the Internet or a router using another protocol.
-s Supplies routing information even if there is only one network interface, which normally tells routed to assume that it is not an internetwork router.
-q Does not supply routing information even if there are multiple network interfaces.
-t Runs routed linked through the terminal, so packet information is shown on STDOUT and the process can be killed using Ctrl-C. Used for testing purposes.
filename If you end the line with a filename, that file is used to log routed’s behavior.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset