background image
Configuring IP Routing in Our Network
271
172.16.40.1, which is the interface of 2501B. Router 2621A will only send
packets to the 172.16.10.2 interface of 2501A.
To configure a default route, you use wildcards in the network address
and mask locations of a static route. (In fact, you can just think of a default
route as a static route that uses wildcards instead of network and mask infor-
mation.) In this section, you'll create a default route on the 2501C router.
Router 2501C is directly connected to networks 172.16.40.0 and
172.16.50.0. The routing table needs to know about networks 172.16.10.0,
172.16.20.0, and 172.16.30.0. To configure the router to route to the other
three networks, I placed three static routes in the routing table. By using
a default route, you can just create one static route entry instead. First,
you must delete the existing static routes from the router, then add the
default route.
2501C(config)#no ip route 172.16.10.0 255.255.255.0
172.16.40.1
2501C(config)#no ip route 172.16.20.0 255.255.255.0
172.16.40.1
2501C(config)#no ip route 172.16.30.0 255.255.255.0
172.16.40.1
2501C(config)#ip route 0.0.0.0 0.0.0.0 172.16.40.1
If you look at the routing table now, you'll see only the two directly con-
nected networks, plus an S*, which indicates that this entry is a candidate for
a default route.
2501C#sh ip route
[output cut]
Gateway of last resort is 172.16.40.1 to network 0.0.0.0
172.16.0.0/24 is subnetted, 5 subnets
C 172.16.50.0 is directly connected, Ethernet0
C 172.16.40.0 is directly connected, Serial0
S* 0.0.0.0/0 [1/0] via 172.16.40.1
2501C#
Notice also in the routing table that the gateway of last resort is now set.
However, there is one more command you must be aware of when using
default routes: the ip classless command.
All Cisco routers are classful routers, which means they expect a default
subnet mask on each interface of the router. When a router receives a
packet for a destination subnet not in the routing table, it will drop the
Copyright ©2002 SYBEX, Inc., Alameda, CA
www.sybex.com