Hello speedosuper.
In this topology, R1 and R2 are running OSPF. We want R2 to advertise a default route into OSPF to R1. The default-information originate command can be used to achieve that.
R2(config)#router ospf 110
R2(config-router)#default-information originate
Now if we check the routing table on R1
R1(config)#do show ip route ospf
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area, * - candidate default, U - per-user static routeo - ODR, P - periodic downloaded static route, H - NHRP, l - LISPa - application route+ - replicated route, % - next hop override, p - overrides from PfR
Gateway of last resort is not set
R1(config)#
We can see that it didnât receive a default route. Why? The default route is only sent to neighbors if the advertising router actually has it configured. R2 doesnât have a default route configured so it wonât advertise it even if you issue this command.
We can simply fix this by actually configuring a default route on R2.
R2(config)#ip route 0.0.0.0 0.0.0.0 G0/1 192.168.23.3
R1(config)#do show ip route ospf
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area, * - candidate default, U - per-user static routeo - ODR, P - periodic downloaded static route, H - NHRP, l - LISPa - application route+ - replicated route, % - next hop override, p - overrides from PfR
Gateway of last resort is 192.168.12.2 to network 0.0.0.0
O*E2 0.0.0.0/0 [110/1] via 192.168.12.2, 00:00:19, GigabitEthernet0/0
R1(config)#
Since R2 now has a default route configured and we issued the default-information originate command, it will happily advertise it to R1. The only requirement is to have the advertising router (R2) actually configured with a static default route.
Now, is it possible for R2 to advertise a default route even if it has none configured?
R2(config)#no ip route 0.0.0.0 0.0.0.0 G0/1 192.168.23.3
The answer is yes. All you need to do is to type the same command but with the addition of the always keyword. This tells R2 to always advertise the default route, even if itâs not actually configured.
R2(config)#router ospf 110
R2(config-router)#default-information originate always
R1(config)#do show ip route ospf
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area, * - candidate default, U - per-user static routeo - ODR, P - periodic downloaded static route, H - NHRP, l - LISPa - application route+ - replicated route, % - next hop override, p - overrides from PfR
Gateway of last resort is 192.168.12.2 to network 0.0.0.0
O*E2 0.0.0.0/0 [110/1] via 192.168.12.2, 00:00:19, GigabitEthernet0/0
R1(config)#
So the differences are:
default-information originate - advertise a default route to your neighbors in OSPF but only if you have the default route configured
default-information originate always - always advertise a default route to your neighbors in OSPF, even if itâs not configured on you, the advertising router.
As for your lab, itâs hard to tell what exactly happened without the topology or any form of output. If you still have it, feel free to provide it!
David