Static Routes

Another method of controlling routes is to manually configure the entries into the routing table. The reasons for doing this include the following:

• This may be done to prevent the need for a routing protocol to run on the network, reducing the network overhead to nil, zero, and zilch. This is used in dialup lines (dial-on-demand routing).

• This also may be done if there are two autonomous systems that do not need to exchange the entire routing table, but simply a few routes.

• The other reason is to change the mask of the network. For example, as seen in BGP-4, you can statically define a supernet and redistribute the static route into the BGP-4 process. This is also done when redistributing from a routing protocol that understands VLSM to one that does not.

The following explains the syntax for configuring the static route:

ip route prefix mask address [distance] [tag tag] [permanent]

This defines the path by stating the next-hop router to which to send the traffic. This configuration can be used only if the network address for the next-hop router is in the routing table. If the static route needs to be advertised to other routers, it should be redistributed.

ip route prefix mask interface [distance] [ tag tag] [ permanent]

In some versions of the IOS, this route is automatically redistributed because it is viewed as a connected network, as long as the output interface is referred in the static route instead of an IP address.

Table 10-8 explains the options available in the static route command.

Table 10-8 Explanation of the IP Route Options

Command Description prefix The route prefix for the destination.

mask The prefix mask for the destination.

address The IP address of the next-hop router that can be used to reach that network.

interface The network interface to use to get to the destination network.

distance Optional administrative distance to assign to this route. (Recall that administrative distance refers to how believable the routing protocol is.)

tag tag Optional value that can be used as a match value in route maps.

permanent Specification that the route will not be removed even if the interface associated with the route goes down.

NOTE Use static routes only with the outgoing interface configuration on point-to-point interfaces.

Static routes configured on multipoint or multiaccess interfaces need a next-hop address. On point-to-point interfaces, the information is sent to the only other device on the network.

In Example 10-3 (and the corresponding Figure 10-9), the use of a static route as well as the passive interface command is illustrated. Additional configuration is included to place the commands in context; the commands relevant to this section are placed in bold.

Example 10-3 The use of Static Routing and Passive Interfaces

Router A

ipx routing 0200.aaaa.aaaa username RouterB password Shhh dialer-list 1 protocol ip permit interface bri 0 encapsulation ppp ip addr ipx network 1012 ppp authentication chap dialer map ip broadcast name RouterB 1222555222201

dialer-group 1

interface ethernet 0

ip address

ipx network 1011

ip route router igrp 1 network passive interface s0

In this example, the link between routers A and B is raised when the Router A sees "interesting traffic" try to exit the serial interface. "Interesting traffic" is traffic that is permitted in a preconfigured access list. In this example, all IP traffic is considered interesting. This example is perfectly valid for occasional access, except for the few additional ISDN parameters that need to be added. Figure 10-9 illustrates the use of both static routes and passive interfaces.

Figure 10-9 The Use of Static Routes Across a Dialup Link

Figure 10-9 The Use of Static Routes Across a Dialup Link

Note: No routing protocol is running.

In this example, you see that IGRP updates do not flow across the dialup line because the interface s0 has been configured as a passive interface. The same configuration has been applied to Router B so that no updates raise the WAN link.

Neither Router A nor Router B knows of the networks on the other side of the WAN, so static routes must be configured.

Was this article helpful?

0 0

Post a comment