Routing – OSPF default route, 2 routers connecting to ISP

cisco-iosospfrouting

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
|----(my_network/cloud)-----|

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?

Best Answer

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.

Related Topic