How to configure OSPF Default Route

With OSPF, it is no problem to configure a default route. There are a couple of options if you want to do this. Here’s an example:

R1 R2 OSPF Area 0
R1(config)#router ospf 1  
R1(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
  <cr>

There are a number of things. We can change the metric or metric type, but the most important thing most people forget is the always keyword.

If you use the default-information originate command, you can advertise a default route in OSPF. OSPF won’t advertise a default route if you don’t already have it in your routing table. If you add the always keyword, it will advertise the default route even if you don’t have it in the routing table. Once you have advertised the default route, it will look like this on other routers:

R2#show ip ospf database | begin Type-5
		Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag
0.0.0.0         172.16.3.1      59          0x80000001 0x008D64 1
R2#show ip route ospf 
O*E2 0.0.0.0/0 [110/1] via 192.168.12.1, 00:00:24, FastEthernet0/0

It will show up as an LSA type 5 external route.

Unit 1: Introduction to OSPF

Unit 2: OSPF Neighbor Adjacency

Unit 3: OSPF Network Types

Unit 4: OSPF Stub Areas

Unit 5: Advanced OSPF Topics