Like IGRP and EIGRP, OSPF does not automatically propagate a default route. To originate a default route with OSPF, configure OSPF with the default-information originate command:
router ospf 10 network 172.18.43.0 0.0.0.255 area 0 <other network commands>
default-information originate metric 20 metric-type 1
where ip route 0.0.0.0 0.0.0.0 172.18.44.2 configures the default route and gateway of last resort.
The command default-information originate metric 20 metric-type 1 tells OSPF to propagate 0.0.0.0 with a starting metric of 20. This behaves like the redistribute command except it only redistributes the default route. The parameter metric-type 1 tells OSPF to advertise the route as an external type 1 route. External type 1 and type 2 routes are covered in "Configuring Redistribution," earlier in this chapter.
When an OSPF router receives the default route from the originator, you will see 0.0.0.Ü in the lable, as shown in die following output of show ip route:
0SPF-Router#sh ip ro
Codes: C • connected, S static, I - IGRP, R • RIP, M - mobile, B - BGP D EIGRP, EX • EIGRP external, 0 • OSPF, IA OSPF inter area N1 - OSPF NSSA external type 1, N2 OSPF NSSA external type 2 El 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 - peruser static route, o OOR T traffic engineered route
Gateway of last resort is 172.18.43.2 to network 0.0.0.0
172.18.0.0/16 is variably subnetted, 5 subnets, 2 masks
0 E2 172.18.200.0/24 [110/10] via 172.18.43.2, 01:39:39, Seriell
0 E2 172.18.44.0/24 [110/10] via 172.18.43.2, 01:44:42, Seriall
C 172.18.43.0/24 is directly connected, Seriall
C 172.18.4.0/22 is directly connected, Ethernet©
C 172.18.1.0/24 is directly connected, Serial0
0*E1 0.0.0.0/0 [110/45] via 172.18.43.2, 00:01:12, Seriall
In the preceding output, the two lines highlighted in boldface confirm that this router received the default route, it came from 172.18.43.2; therefore, 172.18.43.2 is this router's gateway of last resort.
Was this article helpful?