Summarization has been examined in several chapters so far. Summarization conserves network resources by reducing the size of route tables and route advertisements. The smaller, simpler route tables can also make management and troubleshooting easier.
A summary address is an address that represents several, sometimes many, more-specific addresses. For example, the following four subnets
192.168.200.128/27 192.168.200.160/27 192.168.200.192/27 192.168.200.224/27
can be summarized with the single address 192.168.200.128/25.
When examined in binary, the addresses reveal that the summary address is less specific because it consists of fewer network and subnet bits than the addresses being summarized. So put crudely, it might be said that as more zeros are added to the host space and as fewer network bits are used, more addresses are summarized. Taking this concept to its limit, what if so many zeros are added to the host space that no network bits remain? In other words, what if the summary address consists of 32 zeros and has a prefix length of 0 (0.0.0.0/0)? This address summarizes every possible IPv4 address.
0.0.0.0/0 is the IPv4 default address, and a route to 0.0.0.0/0 is a default route.[1] Similarly, the default IPv6 address ::/0 summarizes every possible IPv6 address. Every other IP address is more specific than the default address, so when a default route exists in a route table, that route will be matched only if a more specific match cannot be made.
When a router is connected to the Internet, a default route is immensely useful. With a default route, the router needs to only recognize destinations that are internal to its own administrative system. The default route will forward packets destined for any other address to the Internet service provider. This negates the necessity of running Border Gateway Protocol (BGP) with the service provider to learn all of the prefixes in the Internet route table—a table which consists of well over 100,000 prefixes, and might soon be approaching 200,000. In dealing with large route tables, topology changes are an even bigger concern than the demands on memory. In a large network, topology changes will occur more frequently, resulting in increased system activity to advertise and process those changes. Using a default route effectively “hides” the changes of more-specific routes, making the network to which the default points appear more stable from the point of view of the router using the default route.
Default routes are also useful on a smaller scale, within single autonomous systems. The same benefits of decreased memory and processor utilization can be gained in smaller networks, although the benefits decrease as the number of routes decreases.
Default routes are also very useful in hub-and-spoke topologies, such as the one in Figure 12-1. Here, the hub router has a static route to every remote subnet. Entering new static routes in the hub router when a new subnet is brought online is a fairly trivial administrative task, but adding the routes to every spoke router might be much more time-consuming. By using default routes at the spoke routers, only the hub needs entries for every subnet. When a spoke router receives a packet for an unknown destination, it will forward the packet to the hub, which can, in turn, forward the packet to the correct destination.
Figure 12-1. Default routes greatly simplify the administration of static routing in a hub-and-spoke network.
The spoke routers in Figure 12-1 are more correctly called “stub” routers. A stub router has only a single connection to another router. The routing decisions become very simple in such a device: The destination is either one of the router’s directly connected networks (stub networks), or it is reachable via its single neighbor. And if the single neighbor is the only next-hop routing choice, the stub router has little need for a detailed route table. A default route is usually sufficient.
As with other summary routes, the trade-off with default routes is a loss of routing detail. The stub routers in Figure 12-1, for instance, have no way of knowing whether a destination is unreachable. All packets to unknown destinations are forwarded to the hub router, and only then is reachability determined. Packets to nonexistent addresses should be infrequent in a network. If for some reason they are not, a better design choice might be to allow the stub routers to run a routing protocol and learn routes from the hub so that unknown destinations can be determined as soon as possible. The design choice for you to make in a network such as the one in Figure 12-1 is whether it is more economical to forward packets with unknown destinations to the hub router, which can then drop them, or whether it is more economical to run a dynamic routing protocol between the hub and stub routers just to drop packets to unknown destinations at the stub routers. Although the resource and operational costs of running a dynamic routing protocol are usually small, the default route is still more likely to be the best choice.
Another problem with loss of routing detail is shown in Figure 12-2. These routers form a nationwide backbone, and large local networks are connected to each of the backbone routers. The Los Angeles backbone router has default routes pointing to both San Francisco and San Diego. If Los Angeles must forward a packet to Seattle and has only the two default routes, it has no way of knowing that the best route is via San Francisco. Los Angeles might forward the packet to San Diego, in which case the packet will use a small portion of some very expensive bandwidth, and will incur some unnecessary propagation delay, before it belatedly reaches its destination. Using default routes on this backbone is a bad design decision,[2] but it illustrates how hiding route details with a default route can lead to suboptimal routing.
Although the configuration of static routes is simple in a hub router such as the one in Figure 12-1, many network administrators still see static routes as administratively undesirable. The difficulty is not so much adding routes as new stub networks are brought online, as it is remembering to remove routes when stub networks or stub routers are taken offline. Beginning with IOS 11.2, Cisco offers a proprietary alternative for hub routers called On-Demand Routing (ODR).
With ODR, a hub router can automatically discover stub networks while the stub routers still use a default route to the hub. ODR conveys address prefixes—that is, only the network portion of the address—rather than the entire address—so VLSM is supported. And because only minimal route information is traversing the link between the stub and hub routers, bandwidth is conserved.
ODR is not a true routing protocol. It discovers information about stub networks but does not provide any routing information to the stub routers. The link information is conveyed by a data-link protocol and, therefore, does not go further than from the stub router to the hub router. However, as a case study will show, ODR-discovered routes can be redistributed into dynamic routing protocols.
Example 12-1 shows a route table containing ODR entries. The table shows that the administrative distance is 160; the metric of the routes is 1. Because ODR routes are always from a hub router to a stub router, the metric (hop count) will never be more than 1. The routes also show that VLSM is supported.
Example 12-1. This route table shows several ODR entries.
Router#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default U - per-user static route, o - ODR Gateway of last resort is not set 192.168.1.0/24 is variably subnetted, 3 subnets, 2 masks o 192.168.1.40/30 [160/1] via 192.168.1.37, 00:00:27, Serial0 C 192.168.1.36/30 is directly connected, Serial0 C 192.168.1.192/27 is directly connected, Ethernet1 o 192.168.3.0/24 [160/1] via 192.168.1.37, 00:00:27, Serial0 192.168.4.0/24 is variably subnetted, 2 subnets, 2 masks o 192.168.4.48/29 [160/1] via 192.168.1.37, 00:00:27, Serial0 o 192.168.4.128/27 [160/1] via 192.168.1.37, 00:00:27, Serial0 Router#
The transport mechanism for ODR routes is Cisco Discovery Protocol (CDP), a proprietary data link protocol that gathers information about neighboring network devices.[3] Example 12-2 shows the type of information collected by CDP.
Example 12-2. CDP collects information about neighboring Cisco network devices.
Bumble#show cdp neighbors detail
-------------------------
Device ID: P8R1
Entry address(es):
IP address: 10.131.223.226
Platform: Cisco 2620, Capabilities: Router
Interface: Serial0/0.708, Port ID (outgoing port): Serial0/0.807
Holdtime : 144 sec
Version :
Cisco Internetwork Operating System Software
IOS (tm) C2600 Software (C2600-J1S3-M), Version 12.3(6), RELEASE SOFTWARE (fc3)
Copyright (c) 1986-2004 by Cisco Systems, Inc.
Compiled Wed 11-Feb-04 19:24 by kellythw
advertisement version: 2
-------------------------
Device ID: Blathers
Entry address(es):
IP address: 192.168.3.2
Platform: cisco 2610, Capabilities: Router
Interface: Serial0/0.1, Port ID (outgoing port): Serial0/0.2
Holdtime : 122 sec
Version :
Cisco Internetwork Operating System Software
IOS (tm) C2600 Software (C2600-J1S3-M), Version 12.3(10a), RELEASE SOFTWARE (fc2
)
Copyright (c) 1986-2004 by Cisco Systems, Inc.
Compiled Fri 22-Oct-04 20:43 by kellythw
advertisement version: 2
-------------------------
Bumble#
-------------------------
CDP runs on any media that supports the subnetwork access protocol (SNAP), which means that ODR also depends on SNAP support. Although CDP is enabled by default on all interfaces of all Cisco devices running IOS 10.3 and later, ODR support begins with IOS 11.2. The configuration case study will show that ODR is configured on the hub router only; however, the stub routers must run IOS 11.2 or later for the hub router to discover their attached networks.
Default routes can be configured either on each router that needs a default route or on one router that in turn advertises the routes to its peers. The case studies of this section examine both methods.
Recall from the discussion of classful route lookups in Chapter 5, “Routing Information Protocol (RIP),” that a router first matches a major network number and then matches the subnet. If a subnet cannot be matched, the packet will be dropped. Classless route lookup is the default behavior on Cisco routers as of IOS 11.3 and later; for earlier IOS versions, lookups can be changed to classless (even for classful routing protocols) with the global command ip classless.
Any router using a default route must perform classless route lookups. Figure 12-3 shows why. In this network, Memphis is speaking a dynamic routing protocol to Tanis and Giza, but is not receiving routes from Thebes. Memphis has a default route pointing to Thebes for routing packets to BigNet. If Memphis receives a packet with a destination address of 192.168.1.50 and is performing classful route lookups, it will first match major network 192.168.1.0, of which it has several subnets in its route table. Memphis will then attempt to find a route for subnet 192.168.1.48/28, but because Memphis is not receiving routes from Thebes, this subnet is not in its route table. The packet will be dropped.
Figure 12-3. Memphis forwards packets to Thebes with a default route. If Memphis uses classful route lookups, subnet 192.168.1.48/28 will be unreachable.
If Memphis is configured with ip classless, it will try to find the most specific match for 192.168.1.48/28 without matching the major network first. Finding no match for this subnet in the route table, it will match the default route and forward the packet to Thebes.
The configuration of Memphis in Figure 12-3 is displayed in Example 12-3.
Example 12-3. Configuration of Router Memphis uses static IPv4 and IPv6 routes to create default routes.
interface serial 0/0.1 ip address 192.168.1.33 255.255.255.240 ipv6 address 2001:db8:0:20::1/64 ipv6 rip egypt enable ! interface serial 0/0.2 ip address 192.168.1.81 255.255.255.240 ipv6 address 2001:db8:0:50::1/64 ipv6 rip egypt enable ! interface serial 0/0.3 ip address 192.168.1.17 255.255.255.240 ipv6 address 2001:db8:0:10::1/64 ipv6 rip egypt enable ! router rip network 192.168.1.0 ! ip classless ip route 0.0.0.0 0.0.0.0 192.168.1.82 ipv6 route ::/0 2001:DB8:0:50::2
The static routes configure the default route addresses of 0.0.0.0 and ::/0 and use a mask that is also 0.0.0.0 (prefix length 0 for IPv6). A common mistake made by people configuring default routes for the first time is to use an all-ones mask instead of an all-zeros mask, such as the following:
ip route 0.0.0.0 255.255.255.255 192.168.1.82
An all-ones mask would configure a host route to 0.0.0.0, and the only packets that would match this address would be those with a destination address of 0.0.0.0. The all-zeros mask, on the other hand, is a mask made up entirely of “don’t care” bits and will match any bit in any position. The beginning of this chapter described the default address as a summary route taken to its extreme so that every bit is summarized with a zero. The mask of the default route is a summary mask taken to its extreme.
Memphis’ default route has a next-hop address at Thebes. This next-hop address is the gateway of last resort, or the default router. Example 12-4 shows the IPv4 route table at Memphis. The route to 0.0.0.0 is tagged as a candidate default, and the gateway of last resort is indicated at the top of the table. Example 12-5 shows the IPv6 route table.
Example 12-4. Memphis’ IPv4 route table, showing the default route and the gateway of last resort.
Memphis#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
U - per-user static route, o - ODR
Gateway of last resort is 192.168.1.82 to network 0.0.0.0
192.168.1.0/28 is subnetted, 7 subnets
R 192.168.1.96 [120/1] via 192.168.1.18, 00:00:15, Ethernet0
R 192.168.1.64 [120/1] via 192.168.1.34, 00:00:27, Ethernet1
C 192.168.1.80 is directly connected, Serial0
C 192.168.1.32 is directly connected, Ethernet1
C 192.168.1.16 is directly connected, Ethernet0
R 192.168.1.128 [120/1] via 192.168.1.34, 00:00:27, Ethernet1
R 192.168.1.144 [120/1] via 192.168.1.18, 00:00:15, Ethernet0
S* 0.0.0.0/0 [1/0] via 192.168.1.82
Memphis#
Example 12-5. Memphis’ IPv6 route table shows the static entry for the default address ::/0.
Memphis#show ipv6 route IPv6 Routing Table - 11 entries Codes: C - Connected, L - Local, S - Static, R - RIP, B – BGP U - Per-user Static route I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2 ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2 S ::/0 [1/0] via 2001:DB8:0:50::2 C 2001:DB8:0:10::/64 [0/0] via ::, Serial0/0.3 L 2001:DB8:0:10::1/128 [0/0] via ::, Serial0/0.3 C 2001:DB8:0:20::/64 [0/0] via ::, Serial0/0.1 L 2001:DB8:0:20::1/128 [0/0] via ::, Serial0/0.1 R 2001:DB8:0:40::/64 [120/2] via FE80::204:C1FF:FE50:F1C0, Serial0/0.1 C 2001:DB8:0:50::/64 [0/0] via ::, Serial0/0.2 L 2001:DB8:0:50::1/128 [0/0] via ::, Serial0/0.2 R 2001:DB8:0:90::/64 [120/2] via FE80::205:5EFF:FE6B:50A0, Serial0/0.3 L FE80::/10 [0/0] via ::, Null0 L FF00::/8 [0/0] via ::, Null0 Memphis#
The default route now needs to be advertised to the rest of the RIP routers. This is done by redistributing the static route into RIP. Memphis will not advertise the default route to Tanis and Giza unless the static route is redistributed into the RIP protocol.[4] Example 12-6 shows that a redistribution command is added for both IPv4 and IPv6 on the Memphis router.
Example 12-6. Redistribution commands have been added to Memphis to enable the static default routes to be advertised by RIP.
router rip redistribute static ! ipv6 router rip egypt redistribute static
OSPF and IS-IS do not use the redistribute command to advertise a default route but can still originate default routes, as shown in a subsequent case study. Example 12-7 and Example 12-8 show the IPv4 and IPv6 route tables of Tanis after the static default routes are redistributed into RIP.
Example 12-7. The IPv4 route table of Tanis shows that the default route has been learned from Memphis via RIP.
Tanis#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
U - per-user static route, o - ODR
Gateway of last resort is 192.168.1.17 to network 0.0.0.0
192.168.1.0/28 is subnetted, 9 subnets
C 192.168.1.96 is directly connected, Ethernet1
R 192.168.1.64 [120/2] via 192.168.1.17, 00:00:01, Ethernet0
R 192.168.1.80 [120/1] via 192.168.1.17, 00:00:01, Ethernet0
R 192.168.1.32 [120/1] via 192.168.1.17, 00:00:01, Ethernet0
R 192.168.1.48 [120/2] via 192.168.1.17, 00:00:01, Ethernet0
C 192.168.1.16 is directly connected, Ethernet0
R 192.168.1.224 [120/1] via 192.168.1.17, 00:00:01, Ethernet0
R 192.168.1.128 [120/2] via 192.168.1.17, 00:00:01, Ethernet0
C 192.168.1.144 is directly connected, Ethernet2
R* 0.0.0.0/0 [120/1] via 192.168.1.17, 00:00:02, Ethernet0
Tanis#
Example 12-8. The IPv6 route table of Tanis shows that the default route has been learned from Memphis via IPv6 RIP.
Tanis#show ipv6 route
IPv6 Routing Table - 10 entries
Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP
U - Per-user Static route
I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary
O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2
ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2
R ::/0 [120/2]
via FE80::204:C1FF:FE50:E700, Serial0/0.1
C 2001:DB8:0:10::/64 [0/0]
via ::, Serial0/0.1
L 2001:DB8:0:10::2/128 [0/0]
via ::, Serial0/0.1
R 2001:DB8:0:20::/64 [120/2]
via FE80::204:C1FF:FE50:E700, Serial0/0.1
R 2001:DB8:0:40::/64 [120/3]
via FE80::204:C1FF:FE50:E700, Serial0/0.1
R 2001:DB8:0:50::/64 [120/2]
via FE80::204:C1FF:FE50:E700, Serial0/0.1
C 2001:DB8:0:90::/64 [0/0]
via ::, FastEthernet0/0
L 2001:DB8:0:90::1/128 [0/0]
via ::, FastEthernet0/0
L FE80::/10 [0/0]
via ::, Null0
L FF00::/8 [0/0]
via ::, Null0
Tanis#
Default routes are also useful for connecting classless routing domains. In Figure 12-4, Chimu is connecting a RIP domain with an EIGRP domain. Although the masks of major network 192.168.25.0 are consistent in the RIP domain, they are variably subnetted in the EIGRP domain. Further, the VLSM scheme does not lend itself to summarization into RIP.
Chimu’s configuration is displayed in Example 12-9.
Example 12-9. RIP routes are redistributed into EIGRP by Chimu, but a default route, rather than all the EIGRP routes, is advertised into the RIP domain.
router eigrp 1 redistribute rip metric 1000 100 255 1 1500 passive-interface Ethernet0 passive-interface Ethernet1 network 192.168.25.0 ! router rip passive-interface Serial0 network 192.168.25.0 redistribute static ! ip classless ip route 0.0.0.0 0.0.0.0 Null0
Chimu has a full set of routes from the EIGRP domain but is not redistributing them into RIP. Instead, Chimu is advertising a default route. The RIP routers will forward packets with unknown destinations to Chimu, which can then consult its route table for a more-specific route into the EIGRP domain.
Chimu’s static route is pointing to the null interface rather than a next-hop address. If a packet is forwarded to Chimu with a destination on a nonexistent subnet, such as 192.168.25.224/28, the packet will be dropped instead of being forwarded into the EIGRP domain.
An alternative method of configuring default routes is to use the command ip default-network. This command specifies a network address to be used as a default network. The network might be directly connected to the router, specified by a static route, or discovered by a dynamic routing protocol. The command was first introduced for use with IGRP, which doesn’t identify 0.0.0.0 as a default route, so an existing network was flagged as the default instead. Only IGRP, EIGRP, and RIP use this command.
The ip default-network command is a global command and causes any routing protocol that is configured on the router that supports the command to advertise a default route. The default route will be the network specified as an argument to the command if IGRP or EIGRP is used, and it will be 0.0.0.0 with RIP.
The ip default-network command is used with RIP in the configuration of Athens in Figure 12-5. Athens configuration is displayed in Example 12-10.
Figure 12-5. The default-network command is used at Athens to generate a default network advertisement.
Example 12-10. The default-network command can be used by RIP to create a default route.
router rip network 172.16.0.0 ! ip classless ip default-network 10.0.0.0
Example 12-11 shows that network 10.0.0.0 has been tagged as a candidate default route in the Athens route table, but notice that no gateway of last resort is specified. The reason is that Athens is the gateway to the default network. The ip default-network command will cause Athens to advertise a default network, even though no network statement for 10.0.0.0 exists under the RIP configuration (Example 12-12). When using RIP, the ip default-network command configured on Athens causes Athens to advertise 0.0.0.0 as the default network, not the network specified by the ip default-network command.
Example 12-11. Network 10.0.0.0 is tagged as a candidate default in Athens’ route table.
Athens#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
U - per-user static route
Gateway of last resort is not set
* 10.0.0.0/8 is subnetted, 1 subnets
C 10.1.1.0 is directly connected, Ethernet0
172.16.0.0/16 is subnetted, 6 subnets
R 172.16.4.0 [120/2] via 172.16.1.2, 00:00:12, Serial0
R 172.16.5.0 [120/2] via 172.16.1.2, 00:00:12, Serial0
R 172.16.6.0 [120/2] via 172.16.1.2, 00:00:12, Serial0
C 172.16.1.0 is directly connected, Serial0
R 172.16.2.0 [120/1] via 172.16.1.2, 00:00:12, Serial0
R 172.16.3.0 [120/1] via 172.16.1.2, 00:00:12, Serial0
Athens#
Example 12-12. Sparta’s route table shows that Athens is advertising a default route of 0.0.0.0 and that Athens is Sparta’s gateway of last resort.
Sparta#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default U - per-user static route, o - ODR Gateway of last resort is 172.16.1.1 to network 0.0.0.0 172.16.0.0/24 is subnetted, 6 subnets R 172.16.4.0 [120/1] via 172.16.3.2, 00:00:14, Ethernet1 R 172.16.5.0 [120/1] via 172.16.3.2, 00:00:14, Ethernet1 R 172.16.6.0 [120/1] via 172.16.2.2, 00:00:10, Ethernet0 C 172.16.1.0 is directly connected, Serial0 C 172.16.2.0 is directly connected, Ethernet0 C 172.16.3.0 is directly connected, Ethernet1 R* 0.0.0.0/0 [120/1] via 172.16.1.1, 00:00:17, Serial0 Sparta#
As with RIP, EIGRP will advertise a default route to neighbors if the static route to 0.0.0.0 is configured, and EIGRP redistributes static routes. EIGRP advertises the redistributed route as an external route See Chapter 7, “Enhanced Interior Gateway Routing Protocol (EIGRP).”
If the routers in Figure 12-5 are configured to run EIGRP using the ip default-network command, Athens’ configuration will be as displayed in Example 12-13.
Example 12-13. The default-network command can be used with EIGRP to flag a network as a candidate default route.
router eigrp 1 network 10.0.0.0 network 172.16.0.0 ! ip classless ip default-network 10.0.0.0
The ip default-network command remains the same as with RIP, but notice that a network statement for 10.0.0.0 is added to the EIGRP configuration. Since EIGRP sends the actual network address as the default network, that address must be configured to be advertised, as shown in Example 12-14. Compare the route table in Example 12-12 with the table in Example 12-14. RIP flags the route to 0.0.0.0/0 as the default, while EIGRP flags the route to 10.0.0.0/8 as the default network. Because Corinth has learned about the default route from Sparta, that router is Corinth’s gateway of last resort. If the link to Sparta fails, Corinth will use Argos as its gateway of last resort.
Example 12-14. EIGRP uses an actual network address, rather than 0.0.0.0, as the default network. Corinth’s route table shows that network 10.0.0.0 is tagged as the default network.
Corinth#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default U - per-user static route Gateway of last resort is 172.16.3.1 to network 10.0.0.0 D* 10.0.0.0/8 [90/2195456] via 172.16.3.1, 00:02:32, Ethernet0 172.16.0.0/16 is subnetted, 6 subnets C 172.16.4.0 is directly connected, Ethernet1 C 172.16.5.0 is directly connected, Serial0 D 172.16.1.0 [90/1811456] via 172.16.3.1, 00:00:17, Ethernet0 D 172.16.6.0 [90/921600] via 172.16.3.1, 00:00:16, Ethernet0 D 172.16.2.0 [90/793600] via 172.16.3.1, 00:00:16, Ethernet0 C 172.16.3.0 is directly connected, Ethernet0
Notice that in the configuration of Athens, the ip default-network command is a global command. It is not associated with a particular routing protocol. Any routing protocol that is configured on the router that can use the ip default-network command will use it. If both RIP and EIGRP are configured on the router, both protocols will advertise a default route, as shown in Corinth’s route table in Example 12-15.
Example 12-15. Corinth’s route table shows two candidate default routes when Athens is configured with both RIP and EIGRP and using the ip default-network command.
Corinth#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default U - per-user static route Gateway of last resort is 172.16.3.1 to network 10.0.0.0 D* 10.0.0.0/8 [90/2195456] via 172.16.3.1, 00:02:32, Ethernet0 172.16.0.0/16 is subnetted, 6 subnets C 172.16.4.0 is directly connected, Ethernet1 C 172.16.5.0 is directly connected, Serial0 D 172.16.1.0 [90/1811456] via 172.16.3.1, 00:00:17, Ethernet0 D 172.16.6.0 [90/921600] via 172.16.3.1, 00:00:16, Ethernet0 D 172.16.2.0 [90/793600] via 172.16.3.1, 00:00:16, Ethernet0 C 172.16.3.0 is directly connected, Ethernet0 R* 0.0.0.0/0 [120/1] via 172.16.3.1, 00:00:17, Serial0
The EIGRP-discovered default network becomes the gateway of last resort because EIGRP has a lower administrative distance.
There is an inherent lack of control in this method of advertising a default network. If multiple routing protocols are configured on the router, such as RIP and EIGRP, and the ip default-network command is used, there is no way to control or limit which routing protocol advertises the default network. If Athens, in Figure 12-5, is running EIGRP for BigNet, and RIP for the rest of the network, and the ip default-network command is configured with the intent of advertising a default route into RIP, Athens will also advertise a default into EIGRP. This will disrupt routing not only for traffic originating in the RIP network and attempting to route to BigNet, but also for traffic within BigNet.
When injecting routes into a routing protocol, it is always best to choose the method that offers the most control to minimize unintended route propagation.
An OSPF ASBR and an IS-IS interdomain router will not automatically advertise a default route into their routing domains, even when one exists. For example, suppose Athens in Figure 12-5 is configured for OSPF and given a static default route into BigNet. Example 12-16 shows Athens’s configuration.
Example 12-16. Athens now routes with OSPF and has a static default route.
router ospf 1 network 172.16.0.0 0.0.255.255 area 0 ! ip classless ip route 0.0.0.0 0.0.0.0 10.1.1.2
Example 12-17 shows the route tables of Athens and Sparta. Although the static route has caused the gateway of last resort to be set at Athens, Sparta has no knowledge of the default route. The default route must be advertised into the OSPF domain in type 5 LSAs, which means that Athens must be an ASBR. Yet so far, nothing in Athens’ configuration tells it to perform this function.
Example 12-17. The OSPF process at Athens does not automatically advertise the default route into the OSPF domain.
Athens#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default Gateway of last resort is 10.1.1.2 to network 0.0.0.0 10.0.0.0 255.255.255.0 is subnetted, 1 subnets C 10.1.1.0 is directly connected, Ethernet0 172.16.0.0 is variably subnetted, 6 subnets, 2 masks O 172.16.5.0 255.255.255.0 [110/138] via 172.16.1.2, 00:04:17, Serial0 O 172.16.4.1 255.255.255.0 [110/75] via 172.16.1.2, 00:04:17, Serial0 O 172.16.6.1 255.255.255.0 [110/75] via 172.16.1.2, 00:04:17, Serial0 C 172.16.1.0 255.255.255.0 is directly connected, Serial0 O 172.16.2.0 255.255.255.0 [110/74] via 172.16.1.2, 00:04:17, Serial0 O 172.16.3.0 255.255.255.0 [110/74] via 172.16.1.2, 00:04:17, Serial0 S* 0.0.0.0 0.0.0.0 [1/0] via 10.1.1.2 Sparta#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default U - per-user static route, o - ODR Gateway of last resort is not set 172.16.0.0/16 is variably subnetted, 6 subnets, 2 masks O 172.16.5.0/24 [110/74] via 172.16.2.2, 00:06:00, Ethernet1 [110/74] via 172.16.3.2, 00:06:00, Ethernet0 O 172.16.4.1/24 [110/11] via 172.16.3.2, 00:06:00, Ethernet0 O 172.16.6.1/24 [110/11] via 172.16.2.2, 00:06:00, Ethernet1 C 172.16.1.0/24 is directly connected, Serial0 C 172.16.2.0/24 is directly connected, Ethernet1 C 172.16.3.0/24 is directly connected, Ethernet0
The default-information originate command is a specialized form of the redistribute command, causing a default route to be redistributed into OSPF or IS-IS. And like redistribute, the default-information originate command informs an OSPF router that it is an ASBR, or informs an IS-IS router that it is an interdomain router. Also like redistribute, the metric of the redistributed default can be specified, as can the OSPF external metric type and the IS-IS level. To redistribute the default route into the OSPF domain with a metric of 10 and an external metric type of E1, Athens’s configuration will be as displayed in Example 12-18.
Example 12-18. The default-information originate command is used to originate a default route at Athens.
router ospf 1 network 172.16.0.0 0.0.255.255 area 0 default-information originate metric 10 metric-type 1 ! ip classless ip route 0.0.0.0 0.0.0.0 10.1.1.2
Example 12-19 shows that the default route is now being redistributed into OSPF. The route can also be observed in Sparta’s OSPF database (Example 12-20).
Example 12-19. After default-information originate is configured at Athens, the default route is redistributed into the OSPF domain.
Sparta#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
U - per-user static route, o - ODR
Gateway of last resort is 172.16.1.1 to network 0.0.0.0
172.16.0.0/16 is variably subnetted, 6 subnets, 2 masks
O 172.16.5.0/24 [110/74] via 172.16.2.2, 00:14:46, Ethernet0
O 172.16.4.1/32 [110/75] via 172.16.2.2, 00:14:46, Ethernet0
O 172.16.6.1/32 [110/11] via 172.16.2.2, 00:14:46, Ethernet0
C 172.16.1.0/24 is directly connected, Serial0
C 172.16.2.0/24 is directly connected, Ethernet0
C 172.16.3.0/24 is directly connected, Ethernet1
O* E1 0.0.0.0/0 [110/74] via 172.16.1.1, 00:02:55, Serial0
Sparta#
Example 12-20. Like other external routes advertised by an ASBR, the default route is advertised in a type 5 LSA.
Sparta#show ip ospf database external
OSPF Router with ID (172.16.3.1) (Process ID 1)
Type-5 AS External Link States
Routing Bit Set on this LSA
LS age: 422
Options: (No TOS-capability, No DC)
LS Type: AS External Link
Link State ID: 0.0.0.0 (External Network Number )
Advertising Router: 172.16.1.1
LS Seq Number: 80000002
Checksum: 0x5238
Length: 36
Network Mask: /0
Metric Type: 1 (Comparable directly to link state metric)
TOS: 0
Metric: 10
Forward Address: 0.0.0.0
External Route Tag: 1
Sparta#
The default-information originate command also will redistribute into OSPF or IS-IS a default route that has been discovered by another routing process. In the configuration in Example 12-21, the static route to 0.0.0.0 has been eliminated, and Athens is speaking BGP to a router in BigNet.
Example 12-21. Athens is configured to learn routes via BGP rather then statically.
router ospf 1 network 172.16.0.0 0.0.255.255 area 0 default-information originate metric 10 metric-type 1 ! router bgp 65501 network 172.16.0.0 neighbor 10.1.1.2 remote-as 65502 ! ip classless
Athens is now learning a route to 0.0.0.0 from its BGP neighbor and will advertise the route into the OSPF domain via type 5 LSAs (Example 12-22).
Example 12-22. A BGP-speaking neighbor in BigNet is advertising a default route to Athens.
Athens#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
U - per-user static route
Gateway of last resort is 10.1.1.2 to network 0.0.0.0
10.0.0.0/8 is subnetted, 1 subnets
C 10.1.1.0 is directly connected, Ethernet0
172.16.0.0/16 is variably subnetted, 6 subnets, 2 masks
O IA 172.16.4.1/32 [110/139] via 172.16.1.2, 00:16:45, Serial0
O IA 172.16.5.0/24 [110/138] via 172.16.1.2, 00:16:45, Serial0
O IA 172.16.6.1/32 [110/75] via 172.16.1.2, 00:16:45, Serial0
C 172.16.1.0/24 is directly connected, Serial0
O IA 172.16.2.0/24 [110/74] via 172.16.1.2, 00:16:45, Serial0
O IA 172.16.3.0/24 [110/74] via 172.16.1.2, 00:16:45, Serial0
B* 0.0.0.0/0 [20/0] via 10.1.1.2, 00:12:02
Athens#
A benefit of a default route, or any summary route, is that it can add stability to a network. But what if the default route itself is unstable? For example, suppose that the default route advertised to Athens in Example 12-19 is flapping, that is, alternating frequently between reachable and unreachable. With each change, Athens must send a new type 5 LSA into the OSPF domain. This LSA will be advertised into all nonstub areas. Although this flooding and reflooding might have minimal impact on system resources, it still might be undesirable to the network administrator. A solution is to use the always keyword.[5] Example 12-23 shows how Athens is configured to always originate a default route, even if the default route is not currently present in Athens’s route table.
Example 12-23. Athens will always originate a default route, even if no default route is currently present in the route table.
router ospf 1 network 172.16.0.0 0.0.255.255 area 0 default-information originate always metric 10 metric-type 1 ! router bgp 65501 network 172.16.0.0 neighbor 10.1.1.2 remote-as 65502 ! ip classless
With this configuration, Athens will always advertise a default route into the OSPF domain, regardless of whether it actually has a route to 0.0.0.0. If a router within the OSPF domain defaults a packet to Athens and Athens has no default route, it will send an ICMP Destination Unreachable message to the source address and drop the packet.
The always keyword can be used safely when there is only a single default route out of the OSPF domain. If more than one ASBR is advertising a default route, the defaults should be dynamic—that is, the loss of a default route should be advertised. If an ASBR claims to have a default when it doesn’t, packets can be forwarded to it instead of to a legitimate ASBR.
The default-information originate works similarly for IPv6. In Figure 12-5, IPv6 is being routed via IS-IS. Athens is configured to originate a default route for IPv6.
Athens’s configuration is shown in Example 12-24.
Example 12-24. A default IPv6 route is originated by Athens for the IS-IS protocol.
ipv6 unicast-routing interface Ethernet0 ip address 10.1.1.1 255.255.255.0 ipv6 address 2001:DB8:0:A1::1/64 ipv6 router isis ! interface Serial0 ip address 172.16.1.1 255.255.255.0 ip router isis ipv6 address 2001:DB8:0:1::1/64 ipv6 router isis ! router isis net 01.0000.00ef.5678.00 metric-style wide address-family ipv6 multi-topology default-information originate exit-address-family
Athens does not require that the default route be learned from another source before entering the default route into its IS-IS database and advertising it to neighbors. All data destined to unknown IPv6 addresses is forwarded to Athens by the other routers. If Athens does not have a route to the destination in its route table, it will drop the packet. Example 12-25 shows the Argos IS-IS level-2 database entry for Athens. Example 12-26 shows the Argos IPv6 route table.
Example 12-25. IPv6 default routes are added to the level-2 IS-IS database.
Argos#show isis database detail level-2 Athens.00-00
IS-IS Level-2 LSP Athens.00-00
LSPID LSP Seq Num LSP Checksum LSP Holdtime ATT/P/OL
Athens.00-00 0x00000088 0xBD29 956 0/0/0
Area Address: 01
Topology: IPv4 (0x0) IPv6 (0x2)
NLPID: 0xCC 0x8E
Hostname: Athens
IP Address: 172.16.1.1
IPv6 Address: 2001:DB8:0:A1::1
Metric: 10 IS-Extended Athens.01
Metric: 10 IS (MT-IPv6) Athens.01
Metric: 10 IP 172.16.1.0/24
Metric: 0 IPv6 (MT-IPv6) ::/0
Metric: 10 IPv6 (MT-IPv6) 2001:DB8:0:1::/64
Metric: 20 IPv6 (MT-IPv6) 2001:DB8:0:2::/64
Metric: 20 IPv6 (MT-IPv6) 2001:DB8:0:3::/64
Metric: 30 IPv6 (MT-IPv6) 2001:DB8:0:4::/64
Metric: 30 IPv6 (MT-IPv6) 2001:DB8:0:5::/64
Metric: 30 IPv6 (MT-IPv6) 2001:DB8:0:6::/64
Metric: 30 IPv6 (MT-IPv6) 2001:DB8:0:20::/64
Metric: 10 IPv6 (MT-IPv6) 2001:DB8:0:A1::/64
Argos#
Example 12-26. IPv6 default routes are added to the IPv6 route table as IS-IS level-2.
Argos#show ipv6 route
IPv6 Routing Table - 14 entries
Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP
U - Per-user Static route
I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary
O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2
ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2
I2 ::/0 [115/20]
via FE80::204:C1FF:FE50:E700, FastEthernet0/1
I1 2001:DB8:0:1::/64 [115/20]
via FE80::204:C1FF:FE50:E700, FastEthernet0/1
C 2001:DB8:0:2::/64 [0/0]
via ::, FastEthernet0/1
L 2001:DB8:0:2::2/128 [0/0]
via ::, FastEthernet0/1
I1 2001:DB8:0:3::/64 [115/20]
via FE80::204:C1FF:FE50:E700, FastEthernet0/1
via FE80::204:C1FF:FE50:F1C0, Serial0/0.2
I1 2001:DB8:0:4::/64 [115/20]
via FE80::204:C1FF:FE50:F1C0, Serial0/0.2
C 2001:DB8:0:5::/64 [0/0]
via ::, Serial0/0.2
L 2001:DB8:0:5::1/128 [0/0]
via ::, Serial0/0.2
C 2001:DB8:0:6::/64 [0/0]
via ::, FastEthernet0/0
L 2001:DB8:0:6::1/128 [0/0]
via ::, FastEthernet0/0
I1 2001:DB8:0:20::/64 [115/20]
via FE80::204:C1FF:FE50:F1C0, Serial0/0.2
I1 2001:DB8:0:A1::/64 [115/30]
via FE80::204:C1FF:FE50:E700, FastEthernet0/1
L FE80::/10 [0/0]
via ::, Null0
L FF00::/8 [0/0]
via ::, Null0
Argos#
ODR is enabled with a single command, router odr. No networks or other parameters must be specified. CDP is enabled by default; it needs to be enabled only if it has been turned off for some reason. The command to enable the CDP process on a router is cdp run; to enable CDP on a specific interface, the command is cdp enable.
Figure 12-6 shows a typical hub-and-spoke topology. To configure ODR, the hub router will have the router odr command. If all routers are running IOS 11.2 or later and the connecting medium supports SNAP (such as the Frame Relay or PVCs shown), ODR is operational and the hub will learn the stub networks. The only configuration necessary at the stub routers is a static default route to the hub.
ODR can also be redistributed. If Baghdad in Figure 12-6 needs to advertise the ODR-discovered routes into OSPF, Baghdad’s configuration might be as displayed in Example 12-27.
Configuration and troubleshooting of default routes are trivial tasks in the simple, loop-free networks shown in this chapter. When topologies are more complex, and especially when they include looping paths, the potential for problems with both default routing and with redistribution increases. Chapter 13, “Route Filtering,” and Chapter 14, “Route Maps,” discuss the tools that are vital to controlling routing behavior in complex topologies.
Command | Description |
---|---|
cdp enable | Enables CDP on an interface |
cdp run | Enables CDP globally on a router |
default-information originate [always] [metric metric-value] [metric-type type-value]{level-1 | level-1-2 | level-2} [route-map map-name] | Generates a default route into OSPF and IS-IS routing domains |
ip classless | Enables classless route lookups so that the router can forward packets to unknown subnets of directly connected networks |
ip default-network network-number | Specifies a network as a candidate route when determining the gateway of last resort |
ip route address mask {address | interface} [distance] [tag tag] [permanent] | Specifies a static route entry |
router odr | Enables On-Demand Routing |
[1] This address is used by all the open IP routing protocols. The Cisco IGRP and EIGRP use an actual network address, advertised as an external route.
[2] Having each backbone router advertise only a default route into its local network, on the other hand, can be a very good design choice, limiting the size of the local route tables.
[3] CDP runs not only on routers but also on Cisco switches and access servers.
[4] Before IOS train 12.0T, if a default route was known in the route table, RIP, IGRP, and EIGRP would automatically advertise it to neighbors, without the need to redistribute the static route into the routing protocol.
[5] This keyword is available only under OSPF. It is not supported under IS-IS.