background image
294 Chapter 5: Network Protocols
The default route shows up in the routing tables in R1, R2, and R3. The default route is defined
with a static ip route command, with destination 0.0.0.0, mask 0.0.0.0. This route matches all
destinations.
The default route on R3 is not used, however, in the first ping on R3. This is because the no ip
classless
command was configured on R3 (not shown). This causes R3's matching logic to
mean "best match in the same network as the destination of the packet." In other words, the
destination (168.13.200.1) is in Class B network 168.13.0.0. Because there is no match between
168.13.200.1 and the known subnets of 168.13.0.0, then the destination is not matched by R3
and the packet is not forwarded. When ip classless is added to R3 (it was already configured on
R1), the routing logic is changed to "best match in the entire routing table." In other words, the
router ignores class rules when routing. Because the route to 0.0.0.0 is a match for any
destination, that route is used and the second ping in Example 5-15 succeeds.
The gateway of last resort, highlighted in the show ip route command output, sounds like a
pretty desperate feature. There are worse things than having to discard a packet in a router, but
this phrase simply references the current default route. It is possible that several default routes
have been configured and then distributed with a routing protocol; the Gateway of last resort is
the currently used default on a particular router. Be careful--multiple defaults can cause a
routing loop.
Another style of configuration for the default route uses the ip default-network command. This
command is used most typically when you want to reach other Class A, B, or C networks by
default, but all the subnets of your own network are expected to be in your own routing tables.
For instance, imagine that the cloud next to Dist1 in Figure 5-31 has subnets of network 10.0.0.0
in it, as well as other networks. (Dist1 could be an ISP router.) The network in Figure 5-31 is
still in use, but instead of the ip route 0.0.0.0 0.0.0.0 168.13.1.101 command, the ip default-
network 10.0.0.0
command is used on R1. R1 uses its route to network 10.0.0.0 as its default
and advertises this route as a default route to other routers. Examples 5-16 and 5-17 show
several details on R1 and R3.
R3(config)#ip classless
R3(config)#^Z
R3#ping 168.13.200.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 168.13.200.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 80/88/112 ms
R3#
Example 5-15
R3--Nuances with Successful Use of Static Route on R1 (Continued)
ch05.fm Page 294 Monday, March 20, 2000 5:06 PM