Which Cisco IOS command is used to advertise a default route into OSPF regardless

The ability to generate and propagate a default route in a network is important. Chapter 4, "Design Fundamentals," discussed the methods of default routes in OSPF areas. This chapter covers the redistribution of an existing default route into OSPF.

You can create a default route using one of the following two methods:

• Advertise 0.0.0.0 inside the domain, but only if the ASBR itself already has a default route.

• Advertise 0.0.0.0 regardless of whether the ASBR has a default route.

The latter method can be set by adding the always keyword to the end of the command; this in essence forces the route to always be present in the routing table. Be careful when using the always keyword. If your router advertises a default route (0.0.0.0) inside your OSPF domain and there is no default route present or a path to reach the destinations, routing is broken. Complete one of the following tasks to prevent this:

• Identify the default route in the configuration; this is accomplished in one of two ways:

— Create a static default route (for example, ip route 0.0.0.0 0.0.0.0 next hop ip_address)

— Create a default network (for example, ip default-network ip_address)

• Configure OSPF to propagate the default network that was just configured. To propagate the default network, use the default-information originate always command.

Which Cisco IOS command is used to advertise a default route into OSPF regardless

348 Chapter 6: Redistribution

This section provided an overview of default routes, and as such, it built on knowledge that you should have regarding default routes. The next section takes a closer look at the default-information originate command and its use in OSPF.

default-information originate Command

Chapter 4 discussed that, by default, normal OSPF area routers do not generate default routes. To have an OSPF router generate a default route, use the following command:

default-information originate [always] [metric metric-value] [metric-type type-value] [route-map map-name]

This command generates an external Type 2 link with link-state ID 0.0.0.0 and network mask 0.0.0.0. This makes the router an ASBR.

In a scenario where the default route for your network is via another routing process, you must be able to advertise this default route throughout the entire OSPF domain. Figure 6-1 shows that Router Trinity is receiving the default route from the RIP network.

Figure 6-1 Default Route

Figure 6-1 Default Route

Which Cisco IOS command is used to advertise a default route into OSPF regardless

A 64.246.202.6I

128.213.100.100/24 128.213.101.100/24 128.213.102.100/24 128.213.103.100/24 0.0.0.0 0.0.0.0

A 64.246.202.6I

128.213.100.100/24 128.213.101.100/24 128.213.102.100/24 128.213.103.100/24 0.0.0.0 0.0.0.0

Router Trinity thus places this default route into its routing table; however, it does not tell the rest of the network of its presence. Because this is the default route for the entire network, Router Trinity needs to advertise this route. To accomplish this objective, you must use the default-information originate command on the OSPF ASBR, Router Trinity, as shown in the following examples.

Which Cisco IOS command is used to advertise a default route into OSPF regardless

Before

In this state, the default route is present in the routing table of Router Trinity. However, Router Neo does not yet have know about this default route, as shown in Example 6-1.

Example 6-1 Router Neo's Routing Table Before the Advertisement of the Default Route on Router Trinity

Neo>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, ia - IS-IS inter area * - candidate default, U - per-user static route, o - ODR P - periodic downloaded static route

Gateway of last resort is not set

FastEthernet0/0 FastEthernet0/0

5.1, 00:09:52, FastEthernet0/0

64.0.0.0/8 is variably subnetted, 2 subnets, 2 masks O E2 64.246.202.4/30 [110/200] via 10.10.10.1, 00:09:52 O E2 64.246.202.6/32 [110/200] via 10.10 128.213.0.0/22 is subnetted, 1 subnets O E2 128.213.100.0 [110/200] via 10.10.1

10.0.0.0/24 is subnetted, 2 subnets C 10.10.10.0 is directly connected, FastEthernet0/0

O 10.10.20.0 [110/2] via 10.10.10.1, 00:09:52, FastEthernet0/0

C 192.168.254.0/24 is directly connected, FastEthernet0/1 C 192.168.253.0/24 is directly connected, Loopback1 C 192.168.252.0/24 is directly connected, Loopback0 Neo>

During

To "redistribute" the default route that Trinity knows about, use the default-information originate command in OSPF, as shown in Example 6-2.

Example 6-2 Router Trinity Advertises a Default Route

Trinity#config terminal

Enter configuration commands, one per line. End with CNTL/Z. Trinity(config)#router ospf 100

Trinity(config-router)#default-information originate ?

always Always advertise default route metric OSPF default metric metric-type OSPF metric type for default routes route-map Route-map reference

Trinity(config-router)#default-information originate Trinity(config-router)#

350 Chapter 6: Redistribution

After

After entering the command into Router Trinity's configuration, the default route is now present in the routing table of Router Neo, as shown in Example 6-3.

Example 6-3 Router Neo's Routing Table After the Advertisement of the Default Route on Router Trinity

Neo>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, ia - IS-IS inter area * - candidate default, U - per-user static route, o - ODR P - periodic downloaded static route

Gateway of last resort is 10.10.10.1 to network 0.0.0.0

64.0.0.0/8 is variably subnetted, 2 subnets, 2 masks O E2 64.246.202.4/30 [110/200] via 10.10.10.1, 00:12:51, FastEthernet0/0 O E2 64.246.202.6/32 [110/200] via 10.10.10.1, 00:12:51, FastEthernet0/0

128.213.0.0/22 is subnetted, 1 subnets O E2 128.213.100.0 [110/200] via 10.10.10.1, 00:12:51, FastEthernet0/0

10.0.0.0/24 is subnetted, 2 subnets C 10.10.10.0 is directly connected, FastEthernet0/0

O 10.10.20.0 [110/2] via 10.10.10.1, 00:12:51, FastEthernet0/0

C 192.168.254.0/24 is directly connected, FastEthernet0/1 C 192.168.253.0/24 is directly connected, Loopback1 C 192.168.252.0/24 is directly connected, Loopback0 O*E2 0.0.0.0/0 [110/1] via 10.10.10.1, 00:01:34, FastEthernet0/0 Neo>

Notice in the routing table of Example 6-3 that the default route is a Type 2 external route, which as discussed is the default route type for redistributed routes. Also note that the metric has a value of 1. This is not the metric that you should be seeing.

NOTE The default metric for OSPF routes according to Cisco documentation is 10; however, you can clearly see in the routing table that this is not true. Even adding the default-metric command to OSPF on Trinity has no effect in changing the value. I have tested this erroneous behavior on Cisco IOS Software versions ranging from 11.2(18) to 12.0(7), so be aware of it.

The question now becomes "How do you deal with this undocumented feature (that is, bug) and allow a more realistic metric to be given to a default route?" You can do this by adding the metric keyword to the default-information originate command in OSPF. Also, you can change the route from a Type 2 to a Type 1 route at the same time.

Which Cisco IOS command is used to advertise a default route into OSPF regardless

Before

In Example 6-4, Router Trinity has the correct commands in its OSPF configuration; you should be seeing the default route with a metric of 50 (or at the very least 10!). Example 6-4 Router Trinity Configuration Before Altering the Default Metric router ospf 100 log-adjacency-changes summary-address 128.213.100.0 255.255.252.0 redistribute rip metric 200 subnets tag 200 network 10.10.10.0 0.0.0.255 area 10 network 10.10.20.0 0.0.0.255 area 10 default-information originate default-metric 50

Regardless, those metric values are not appearing as they should on Router Neo in Example 65, so you need to alter them and convert the default route to a Type 1 route.

Example 6-5 Router Neo's Routing Table with the Original Default Route and Its Cost

Neo>show ip route

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, ia - IS-IS inter area

* - candidate default, U - per-user static route, o - ODR

P - periodic downloaded static route

Gateway of last resort is 10.10.10.1 to network

O E2

64.0.0.0/8 is variably subnetted, 2 subnets, 2 masks

64.246.202.4/30 [110/200] via 10.10.10.1, 00:25:17, FastEthernet0/0 64.246.202.6/32 [110/200] via 10.10.10.1, 00:25:17, FastEthernet0/0 128.213.0.0/22 is subnetted, 1 subnets

128.213.100.0 [110/200] via 10.10.10.1, 00:25:17, FastEthernet0/0 10.0.0.0/24 is subnetted, 2 subnets C 10.10.10.0 is directly connected, FastEthernet0/0

O 10.10.20.0 [110/2] via 10.10.10.1, 00:25:17, FastEthernet0/0

C 192.168.254.0/24 is directly connected, FastEthernet0/1 C 192.168.253.0/24 is directly connected, Loopback1 C 192.168.252.0/24 is directly connected, Loopback0 O*E2 0.0.0.0/0 [110/1] via 10.10.10.1, 00:13:59, FastEthernet0/0 Neo>

During

Example 6-6 shows the changes that you want to apply to router Trinity because it is the ASBR that is receiving and then redistributing the default route throughout our OSPF domain.

Which Cisco IOS command is used to advertise a default route into OSPF regardless

352 Chapter 6: Redistribution

Example 6-6 Changing the Default Route Cost on Router Trinity

Trinity#conf t

Enter configuration commands, one per line

End with CNTL/Z.

Trinity(config)#router ospf 100

Trinity(config-router)#default-information

originate metric 50 metric-type 1

Trinity(config-router)#"Z

Trinity#

After adding the commands to Router Trinity, you can check the routing table on Neo to see if the changes were successful in getting the results desired for the network (see Example 6-7).

Example 6-7 Router Neo's Routing Table with the Altered Default Route Metric

Neo>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, ia - IS-IS inter area * - candidate default, U - per-user static route, o - ODR P - periodic downloaded static route

Gateway of last resort is 10.10.10.1 to network 0.0.0.0

64.0.0.0/8 is variably subnetted, 2 subnets, 2 masks O E2 64.246.202.4/30 [110/200] via 10.10.10.1, 00:29:15, FastEthernet0/0 O E2 64.246.202.6/32 [110/200] via 10.10.10.1, 00:29:15, FastEthernet0/0

128.213.0.0/22 is subnetted, 1 subnets O E2 128.213.100.0 [110/200] via 10.10.10.1, 00:29:15, FastEthernet0/0

10.0.0.0/24 is subnetted, 2 subnets C 10.10.10.0 is directly connected, FastEthernet0/0

O 10.10.20.0 [110/2] via 10.10.10.1, 00:29:15, FastEthernet0/0

C 192.168.254.0/24 is directly connected, FastEthernet0/1 C 192.168.253.0/24 is directly connected, Loopback1 C 192.168.252.0/24 is directly connected, Loopback0 O*E1 0.0.0.0/0 [110/51] via 10.10.10.1, 00:01:08, FastEthernet0/0 Neo>

The results at this point are mixed. You have the default route now being advertised as a Type E1 route; however, the metric has increased to 51, not 50 as configured. This is another issue with Cisco IOS Software, so be aware that in this case the metrics are cumulative, not set, as you would expect.

However, you are not done. There is a problem in the network where links are unstable. As a result of this, the default route is constantly being withdrawn and then added to the routing tables. This can have a negative impact on the network's operation and performance. The solution with OSPF is to add another keyword to the default-information originate command. If you apply the always keyword to the configuration for Router Trinity, Trinity always advertises the default route regardless of the status of its links. Example 6-8 demonstrates the configuration.

Which Cisco IOS command is used to advertise a default route into OSPF regardless

Example 6-8 Configuring Router Trinity to Always Advertise a Default Route

Trinity#config terminal

Enter configuration commands, one per line. End with CNTL/Z. Trinity(config)#router ospf 100

Trinity(config-router)#default-information originate metric 50 metric-type 1 always

Trinity(config-router)#exit Trinity#

CAUTION Use care in applying the always keyword. If more than one default route exists in your network, the always keyword should not be used because it would cause some traffic to be discarded when another valid route that it could use was present.

There is no obvious effect on the route; however, if you were to shut down the serial link to the RIP domain, you would expect to see all RIP routes be removed from Router Neo's routing table, but the default route remains as a result of the always keyword. Check Example 6-9 to see if this is indeed the case.

Example 6-9 Router Neo's Routing Table After the always Keyword Neo>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, ia - IS-IS inter area * - candidate default, U - per-user static route, o - ODR P - periodic downloaded static route

Gateway of last resort is 10.10.10.1 to network 0.0.0.0

10.0.0.0/24 is subnetted, 2 subnets C 10.10.10.0 is directly connected, FastEthernet0/0

O 10.10.20.0 [110/2] via 10.10.10.1, 00:39:56, FastEthernet0/0

C 192.168.254.0/24 is directly connected, FastEthernet0/1

C 192.168.253.0/24 is directly connected, Loopback1

C 192.168.252.0/24 is directly connected, Loopback0

O*E1 0.0.0.0/0 [110/51] via 10.10.10.1, 00:11:49, FastEthernet0/0

Yes, the RIP routes are all gone, but the default route remains, so this worked as intended. In reviewing the concepts of external and default routes, this has reinforced some concepts with redistribution. Specifically, redistributed routes into OSPF are considered external routes, and a default route can also be redistributed. These characteristics might not be what you intended, so caution is warranted! Remember to go slowly with a plan and check the results at each step. The next section discusses how to assign routing metrics to a routing protocol as it is redistributed into OSPF.

Which Cisco IOS command is used to advertise a default route into OSPF regardless

354 Chapter 6: Redistribution

Continue reading here: Route Tagging

Was this article helpful?