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

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      59          0x80000001 0x008D64 1
R2#show ip route ospf 
O*E2 [110/1] via, 00:00:24, FastEthernet0/0

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


Want to take a look for yourself? Here you will find the final configuration of each device.


hostname R1
interface FastEthernet0/1
 ip address
router ospf 1
 default-information originate always


hostname R2
interface FastEthernet0/1
 ip address
router ospf 1

I hope this is helpful to you. If you have any questions leave a comment.


Forum Replies

  1. What is the use case for this…?


  2. A good example would be a small network where one router has an Internet connection. You can advertise the default route to all routers in the network.

  3. Rene,
    Great lesson I have a question in my lab I have 3 routers
    R1---- 192.168 1.0---- R2
    R2----- ----R3

    I am advertising default route on R2 but I can not ping from R1.
    R1 can see a default route O*E2 [110/1] via, 00:08:46, FastEthernet0/0.

    Please let me know.


  4. Hi Hamood,

    R1 knows the default route so we can assume that the packet makes it from R1 to R2. Since is directly connected to R2, it knows how to reach R3 ( What about the return traffic?

    Does R3 also have the default route in its routing table or is there anything preventing it from responding to R1?


  5. Hi Rene

    I have a couple of questions. Why this is sent as a Type 5 LSA even when the R1 and R2 routers are in same area. I guess since this is a Type 5 LSA it shows as an O*E2 ( External with Metric 2, so the actual cost of R1 to R2)


33 more replies! Ask a question or join the discussion by visiting our Community Forum