How to configure OSPF Default Route

(srinu n) #2

What is the use case for this…?


(Rene Molenaar) #3

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.

(Hamood R) #4

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.


(Rene Molenaar) #5

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?



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)


(Jeffrey D) #7

Type 5 – External LSA: also known as autonomous system external LSA: The external LSAs are generated by the ASBR.

When you generate a default route. You are advertising a route that looks like it from another network. In the example the default route could represent the ISP connection. R1 would represent the ASBR and generate type 5 LSAs (default route).

Hope this helped to answer your question.


Great, thanks Jeffrey. This is what I was looking for.

(sims) #9

Why do we need to advertise a default route to all the routers ?

(Rene Molenaar) #10

Hi Sims,

Let’s say you have a small network with a couple of routers. One router is connected to an ISP router for Internet access. On this router, you could advertise a default route in your OSPF network.

When there is no matching route in the routing table, the default route will be used and your traffic will be forwarded towards the ISP.


(Shawn O) #11

If you have a DMVPN network and a spoke is receiving a bunch of OSPF routes, along with default route (default-info originate), but don’t want a default route, but can’t change that default-information originate command on the hub, can you use some sort of route map or prefix list that you could configure on the spoke to block the default route being advertised?

I hope this makes sense…

(Andrew P) #12

Yes, you can do this, sort of :slight_smile:

Remember that a requirement for OSPF is that all members in the same area must have identical databases (and I presume that your DMVPN hub and spokes are in the same area). So the best you are going to be able to do is keep that default route from getting installed in the routing table, even though it will still be present in the OSPF database. I recommend using a prefix-list to do it. Here’s a sample:

(config)#ip prefix-list PL_NODEFAULT deny
(config)#ip prefix-list PL_NODEFAULT permit le 32
(config)#router ospf 1
(config-router)#distribute-list prefix PL_NODEFAULT in
1 Like
(Shawn O) #13

Andrew, that worked perfectly. Thank you so much!


(sims) #14

What if we have different area and core distribution access layer .
Where we have to put the default originate command

(Lazaros Agapides) #15

Hello Sims

The default information originate command must always be placed on a router that has a route that goes outside of the OSPF domain regardless of the area or of the core, distribution and access layers of the network. The criteria for this command is that the router must have a “way out” of the whole OSPF region.

I hope this has been helpful!


(Pavan C) #16

Suppose If you are using bgp and ospf in a network what is the need of using default route in ospf ? .BGP will take care of default route to isp.

(Rene Molenaar) #17

Hi Pavan,

It depends on the devices behind your BGP router. If you use iBGP everywhere then you won’t need OSPF. If you run OSPF on your internal routers and only BGP on the edge, then a default route in OSPF helps your devices to get to your BGP router.


(Shyam S) #18

Hello Rene,

Could you please explain the use case for using the metric attribute after the default-information originate command? Why would anyone need to use the metric and metric-types attributes.



(Rene Molenaar) #19

Hi Shyam,

Let’s say we have a small network with two OSPF routers that are both connected to an ISP. You configure both routers to advertise a default route.

The E2 type can be useful since the metric remains the same. You can set a low metric on R1 and a higher metric on R2 to ensure that all OSPF routers always use the default route through R1. When R1 fails, they’ll use R2. You can also use the same metric to ensure that both default routes are used.

With the E1 type, the metric changes so OSPF routers will route to the closest router…R1 or R2, you can play a bit with the metric to influence which routers select R1 or R2.

So, that’s why you might want to use the different E1/E2 types and why you might want to change the metric. Hope this helps!


(Brian C) #20

I had a question.

  1. with Static default route we configure something like the following:

ip route

  1. If it was EIGRP and we had the following manually configured default route to advertise in EIGRP we would then use the following:

R2(config)#router eigrp AS#

with OSPF I did not see something similar is that because you just did not put in the full configuration or because OSPF just uses that statement:

default-information originate always

I would think it would need a manual entry for the default route to point where it is going to? such as add a default route statically after that and then this statement will advertise it. I am however, not positive because it was missing any type of manual default route in the configurations.

I guess you state here:

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

I would probably have used the word create instead of advertise but after studying the statement a bit closer I get what you meant.

This is like 4rth - 6th time I am going through the OSPF, and BGP lessons trying to drill down and get everything memorized since Sept 2017(though to be honest had a few breaks in there and forgot everything a couple times… lol) I just want to go play Total War Rome but I will keep studying as I have next two weeks off on vacation and want to put in about 40-48 hours study time each week and prep for my CCNP Route and my new job. I hope to take CCNP Route before End of 2018.

(Rene Molenaar) #21

Hi Brian,

If you use default-information originate always then OSPF advertises a default route, even if you don’t have a default route in your local routing table. The “problem” with this is that you “attract” traffic to destinations that you don’t have a route for. In reality, you probably use this on some edge router that is connected to the Internet and you have a default route pointing to your ISP.

If you wonder about something like this, instead of trying to “think it through”…boot up some routers, configure this on OSPF and see what happens when you send a ping from another router that receives that default route. Seeing it in action lets it sink in your brain 10x faster than trying to brute force things in your memory :smile:


1 Like