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(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 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 a LSA type 5 external route.
Configurations
Want to take a look for yourself? Here you will find the final configuration of each device.
R1
hostname R1
!
interface FastEthernet0/1
ip address 192.168.12.1 255.255.255.0
!
router ospf 1
network 192.168.12.0
default-information originate always
!
end
R2
hostname R2
!
interface FastEthernet0/1
ip address 192.168.12.2 255.255.255.0
!
router ospf 1
network 192.168.12.0
!
end
I hope this is helpful to you, if you have any questions just leave a comment.
What is the use case for this…?
BR,Srini
Shawn,
Yes, you can do this, sort of
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:
... Continue reading in our forumI had a question.
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:
I would think it would need a manual e
... Continue reading in our forumHi 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
... Continue reading in our forumHello Mohammed
Let’s say you have this topology:
https://cdn-forum.networklessons.com/uploads/default/original/2X/5/5fef0b01e0121af2570bb5118978fb33acea9310.png
Let’s assume that R1 has a default route in its routing table via the interface connected to the Internet.
Now if you have the
default information originate
command in R1, then: