At work, we have a network with 2 routers connected to ISPs, and other routers in our internal network like this:

ISP                        ISP
|(BGP)                      |(BGP)
R1                         R2

The default route for my routers in "my_network" is currently R1, and we switch it to R2 manually if there's a problem between R1 and the ISP. We'd like it to be automatic.

R1 and R2 run Cisco IOS and get their default routes to ISP with BGP.

I saw there that OSPF could propagate a default route with default-information originate, but I'm not sure how it works and I have no labs to test it.

If I configure both R1 and R2 like this:

R1 (config)> router ospf
R1 (router-ospf)> network my_network my_network_mask area 1
R1 (router-ospf)> default-information originate

will it do what I want?

Will the R2 default routes announcement have a lower metric than the one from R1 in the case R1 can't reach ISP?


3 Answers 3


You can inject a default route into OSPF with the default-information originate command which will advertise a default route from a router, as long as there is a default route in the routing table of that router.

You can configure a static default route on each router, but have the defaults routes with different administrative distances. The default route with the lowest AD will be preferred, but when that link is down, the other default route will take over.

  • Since he's already getting a default route from the ISP, he doesn't need static routes. Just make the routes type 1 and increase the metric on R2
    – Ron Trunk
    Commented Nov 5, 2015 at 17:44
  • I was just giving an alternative which offers more control. I understand about the default route from the ISP, and that works until it doesn't. I have seen where the default route stops coming from the ISP without the ISP being down. Unfortunately for me. both routers were connected to the same ISP (different POPs), and there was no default route being received, even though the connections to the ISPs were still up and working.
    – Ron Maupin
    Commented Nov 5, 2015 at 17:51
  • Yes. I've also seen ISPs who advertise a default route even when they lose connectivity upstream. There's no end to the ways it can fail insidiously. ;)
    – Ron Trunk
    Commented Nov 5, 2015 at 18:27
  • I found this. It takes the example of a configuration very similar to what I have at work. I can't test this until the whole team approved it, but I think it is the solution I'm searching for. About having 2 static routes with different metric, I think it can work if the link between R1 and other router of "my_network" is down, but I don't think it will work if the problem is on the link between R1 and the ISP.
    – david_loup
    Commented Nov 6, 2015 at 15:35
  • @david_loup If you configure the default routes to point to the WAN port and the ISP router address, it will be removed from the routing table if the link to the ISP fails. ip route <interface> <ISP address> <AD>
    – Ron Maupin
    Commented Nov 6, 2015 at 15:45

If the two routers are on the same network segment on the LAN side you can simply everything and use HSRP to advertise a Virtual IP. Then downstream you point the default route to that VIP.


You can redistribute default route from EBGP into OSPF, but you should form IBGP neighbor between your uplinks routers and either use local preference or AS_Path to control the the outbound traffic, Below simple setup for this

ISP                        ISP
|(BGP)                      |(BGP)
R1                         R2

R1 ------  IBGP ------------- R2
R1  ------ OSPF ------------- R2

The scenario will be like this:

R1 receive default in EBGP from ISP 1 and redistribute it into OSPF

As EBGP AD is 20 R1 will install default route from EBGP and keep the redistributed default in the OSPF DB, R2 will receive default from ISP also here you need to modify either set local preference on R1 to ensure all your traffic will go via R1 or Prepend your ISP AS to the incoming default route from the ISP like

route-map FromISP permit 10
match ip address 1
set as-path prepend ISPAS ISPAS ISPAS

router bgp xxx
neighbour xxxx remote-as xxx
neighboor xxx route-map FromISP in

Now your are receiving 2 Default in 2 routers each router will receive 2 default one from the ISP directly (EBGP) and one from the IBGP neighbour.

Depending on the AS_Path length the router will decide to install one of these defaults routes, R1 will install the one that came from the EBGP because AS-Path length is shorter than that received from the IBGP, R2 will install the default that came from IBGP in the BGP table because it's the AS_Path shorter but will not use it like R1. Why? Because IBGP Administrative distance is 200, OSPF 110 for summary:

R1 - have 3 Default routes : 1 EBGP 1 IBGP 1 OSFP (redistributed from BGP)

  • Routing table of BGP will install the one from EBGP , shorter AS path.
  • Routing table of R1 will install the default from EBGP because AD = 20

R2 - have 3 Default routes : 1 EBGP 1 IBGP 1 OSFP (redistributed from BGP)

  • Routing table of BGP will install the one from IBGP , shorter AS path.
  • Routing table of R2 will install the default from OSPF because AD = 110

Hope this will help to understand

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.