Configuring Static Routes

The route table acquires information in two ways. The information may be entered manually, by means of a static route entry, or automatically by one of several systems of automatic information discovery and sharing known as dynamic routing protocols. The bulk of this book concerns dynamic IP routing protocols, but this discussion of static route configuration will prepare you to understand the subsequent chapters.

More to the point, static routing is preferred over dynamic routing in certain circumstances. As with any process, the more automatic it is, the less control we have over it. Although dynamic (automatic) routing requires much less human intervention, static routing allows very precise control over the routing behavior of an internetwork. The price to be paid for this precision is the necessity of manual reconfiguration any time the topology of the network changes.

NOTE

Discontiguous networks

NOTE

Variable subnetting

Case Study: Simple Static Routes

Figure 3.3 shows an internetwork with four routers and six networks. Notice that the subnets of network 10.0.0.0 are discontiguous—there is a different major network subnet (192.168.1.192, in the Tigger-to-Piglet link) separating 10.1.0.0 from the other 10.0.0.0 subnets. The subnets of 10.0.0.0 are also variably subnetted—the subnet masks are not consistent throughout the internetwork. Finally, the subnet address of Pooh's Ethernet link is an all-zero subnet. Later chapters demonstrate that an addressing scheme with these characteristics causes problems for simpler, classful routing protocols such as RIP and IGRP; static routes work fine here.

Figure 3.3. Routing protocols such as RIP and IGRP cannot easily route this discontiguous, variably subnetted internetwork, but static routing will work.

Figure 3.3. Routing protocols such as RIP and IGRP cannot easily route this discontiguous, variably subnetted internetwork, but static routing will work.

NOTE

The steps for creating simple static route configuration

The procedure for statically routing an internetwork has three steps:

1. For each data link within the internetwork, identify all addresses (subnet or network).

2. For each router, identify all data links not directly connected to that router.

3. For each router, write a route statement for each data link not directly connected to it.

Writing route statements for a router's directly connected data links is unnecessary, because the addresses and masks configured on the router's interfaces cause those networks to be recorded in its route table.

For example, the internetwork in Figure 3.3 has six subnets:

To configure static routes for Piglet, the subnets that are not directly connected are identified as follows:

These are the subnets for which static routes must be written. The commands for entering Piglet's static routes are as follows:131

[31 For the static routes in this example and the subsequent examples in this chapter to work properly, two global commands must be added to the routers: ip classless and ip subnet-zero. These commands are introduced in Chapter 7 and are mentioned here for readers who wish to try the configuration examples in a lab.

Piglet(config)# ip route 192.168.1.0 255.255.255.224 192.168.1.193

Piglet(config)# ip route 192.168.1.64 255.255.255.224 192.168.1.193

Piglet(config)# ip route 10.4.6.0 255.255.255.0 192.168.1.193

Piglet(config)# ip route 10.4.7.0 255.255.255.0 192.168.1.193

Following the same steps, the route entries for the other three routers are:

Pooh(config)# ip route 192.168.1.192 255.255.255.224 192.168.1.66 Pooh(config)# ip route 10.1.0.0 255.255.0.0 192.168.1.66 Pooh(config)# ip route 10.4.6.0 255.255.255.0 192.168.1.66 Pooh(config)# ip route 10.4.7.0 255.255.255.0 192.168.1.66 Tigger(config)# ip route 192.168.1.0 255.255.255.224 192.168.1.65 Tigger(config)# ip route 10.1.0.0 255.255.0.0 192.168.1.194 Tigger(config)# ip route 10.4.7.0 255.255.255.0 10.4.6.2 Eeyore(config)# ip route 192.168.1.0 255.255.255.224 10.4.6.1 Eeyore(config)# ip route 192.168.1.64 255.255.255.224 10.4.6.1 Eeyore(config)# ip route 192.168.1.192 255.255.255.224 10.4.6.1 Eeyore(config)# ip route 10.1.0.0 255.255.0.0 10.4.6.1

The routing commands themselves are easily read if the reader remembers that each command describes a route table entry. The command is ip route, followed by the address to be entered into the table, a mask for determining the network portion of the address, and the address of the directly connected interface of the next-hop router.

An alternative configuration command for static routes specifies the interface out of which a network is reached instead of the address of the next-hop router. For example, the route entries for Tigger could be as follows:

Tigger(config)# ip route 192.168.1.0 255.255.255.224 S0 Tigger(config)# ip route 10.1.0.0 255.255.0.0 E0 Tigger(config)# ip route 10.4.7.0 255.255.255.0 S1

Figure 3.4 compares the route table resulting from this configuration with the route table resulting from entries pointing to a next-hop router. Notice that a certain inaccuracy is introduced; all networks specified with a static route referring to an exit interface are entered into the table as if they are directly connected to that interface. The implications for route redistribution are discussed in Chapter 11.

Figure 3.4. The top route table is the result of static route entries pointing to the next-hop router. The bottom route table is the result of static routes that point to the interface a packet must exit to reach the destination network.[4]

TiQQer#show lp route

Gateway ol ias^ resort is not set

10.0.0.0 is variably subnatted, 3 sutmels. 2 masks C 10.4.6-0 255,255, 255 .(f is :J.t ¡-c c t ly connected , Lion a 1"?

192.168.1.G 255.255.255.224 is subnotted, 3 subnets C 192.168.1 .64 Is directly canfirctod, SerlalO

C 192.166.1.192 is directly connected> EttiernetO

rigger*

liggorfrsnaw ip route

Gateway of las; resort is not set

10.0.0.0 is variably subnet ted, 3 subnets, 2 masks C 10.4.6.0 255,255,2&5,0 is directly connecte:!, Serlall

S 10.4.7.0 255,255,253.W is directly connected, Serial"!

S 13.1.0.0 255,255, S. A is directly !;c.Tnoclc(!, ttiioriteï«

192,1QB. 1,C 255,255,355.22'* is subletted, 3 subnets C 192.168.1.64 is directly connected, Senal0

S 192.168.1.0 is directly connected, Serial®

C 192.168.1.192 is directly connected, Ethernets

I lftgor*_

[4] The key normally seen at the top of the route table (as in Figure 3.2) has been removed for clarity.

A point of interest in Figure 3.4 is that the header for the 10.0.0.0 subnets indicates the variable subnet masks used in the internetwork. Variable Length Subnet Masking (VLSM) can be a useful tool and is discussed at length in Chapter 7.

Case Study: Summary Routes

A summary route is an address that encompasses several more specific addresses in a route table. It is the address mask used with a route entry that makes static routes as flexible as they are; by using an appropriate address mask, it is sometimes possible to create a single summary route for several destination addresses.

For example, the preceding case study uses a separate entry for each data link. The mask of each entry corresponds to the address mask used on the device interfaces connected to that data link. Looking again at Figure 3.3, you can see that subnets 10.4.6.0/24 and 10.4.7.0/24 could be specified to Piglet with a single entry of 10.4.0.0/16, reachable via Tigger. Likewise, subnets 192.168.1.0/27 and 192.168.1.64/27 could be accounted for in its route table with a single entry pointing to 192.168.1.0/24, also reachable via Tigger. These two route entries, 10.4.0.0/16 and 192.16.1.0/24, are summary routes.

Using summary routes, Piglet's static route entries are:

Piglet(config)# ip route 192.168.1.0 255.255.255.0 192.168.1.193 Piglet(config)# ip route 10.4.0.0 255.255.0.0 192.168.1.193

All subnets of network 10.0.0.0 are reachable from Pooh via Tigger, so a single entry to that major network address and a corresponding mask is all that is needed:

Pooh(config)# ip route 192.168.1.192 255.255.255.224 192.168.1.66 Pooh(config)# ip route 10.0.0.0 255.0.0.0 192.168.1.66

From Eeyore, all destination addresses beginning with 192 are reachable via Tigger. The single route entry does not even have to specify all of the class C address bits:[5]

[5] This method of summarizing a group of major network addresses with a mask shorter than the default address mask for that class is known as supermetting and is introduced in Chapter 7.

Eeyore(config)# ip route 192.0.0.0 255.0.0.0 10.4.6.1 Eeyore(config)# ip route 10.1.0.0 255.255.0.0 10.4.6.1

By summarizing a group of subnets or even major networks, the number of static route entries may be reduced drastically—in this example, by more than one-third. However, caution must be used when summarizing addresses; when done incorrectly, unexpected routing behavior may occur (see "Case Study: Tracing a Failed Route," later in this chapter). Summarization and the problems that can develop from incorrect summarization are examined in more depth in Chapters 8, "Enhanced Interior Gateway Routing Protocol (EIGRP)," and 9, "Open Shortest Path First."

Case Study: Alternative Routes

In Figure 3.5, a new link has been added between Pooh and Eeyore. All packets from Pooh to the 10.0.0.0 networks will take this new path with the exception of packets destined for the host 10.4.7.25; a policy is in place stating that traffic to this host must go through Tigger. The static route commands at Pooh will be:

Figure 3.5. A more direct path from Pooh to the 10.4.0.0 subnets is added to the internetwork.

Poohiconfig>ir tp route 192,168,1 ,192 255,255-255-22* 192,160-1.66

Poonfcorfio)* tp route i«.e.e.e »5.4.0.« 192.160.1.34

Pooh I Gonf lg } nf tp route 1fl.4.7.S5 iS5-iSS.S3S.S5S 19J.16B.1.66

Poohiconfig>ir tp route 192,168,1 ,192 255,255-255-22* 192,160-1.66

Poonfcorfio)* tp route i«.e.e.e »5.4.0.« 192.160.1.34

Pooh I Gonf lg } nf tp route 1fl.4.7.S5 iS5-iSS.S3S.S5S 19J.16B.1.66

1Q.4 7.1J24

Pooh(config)# ip route 192.168.1.192 255.255.255.224 192.168.1.66 Pooh(config)# ip route 10.0.0.0 255.0.0.0 192.168.1.34 Pooh(config)# ip route 10.4.7.25 255.255.255.255 192.168.1.66

1Q.4 7.1J24

Pooh(config)# ip route 192.168.1.192 255.255.255.224 192.168.1.66 Pooh(config)# ip route 10.0.0.0 255.0.0.0 192.168.1.34 Pooh(config)# ip route 10.4.7.25 255.255.255.255 192.168.1.66

The first two route entries are the same as before except that the second path now points to the new interface 192.168.1.34 at Eeyore. The third entry is a host route, pointing to the single host 10.4.7.25 and made possible by setting the address mask to all ones. Notice that unlike the entry for the other 10.0.0.0 subnets, this host route points to Tigger's interface 192.168.1.66.

The debugging function debug ip packet is turned on in Pooh (Figure 3.6) to observe the paths packets take from the router as a result of the new route entries. A packet is sent from a host 192.168.1.15 to host 10.4.7.25. The first two debug trap messages show that the packet is routed from interface E0 to the next-hop router 192.168.1.66 (Tigger) out interface S0, as required, and that the reply packet was received on S0 and routed to the host 192.168.1.15 out E0.

0 0

Post a comment