OSPF route selection question....

Unanswered Question
Jun 17th, 2009

Hi All,

If an OSPF router has two default routes sent to it, via different routers and they are both E1 type routes, does it base its route selection on metric only?

My reason for asking is, I have a router is running two OSPF processes and receives a default route from both via the default-information originate metric-type 1 command from connected routers. The reason for this is that the router participates in a "failover" scenario whereby should the internet connection be lost, all traffic is routed out via another router at a different location. I can explain this in a bit more detail if necessary.

One of these routes has a metric of [110/31] and one has a metric of [110/11].

If i issue the clear ip route * command, the router selects the route with the [110/11] metric and places it into its routing table. This is good. If i shut the interface that connects the router that is sending me that route, it immediately places the [110/31] metric route into the routing table. This is also good.

When i re-enable the shutdown interface, the router does not swap back to using the route with the better metric, unless the clear ip route * command is run. Is this by design? I am struggling to drag my OSPF theory out of the depths of my mind!

More info can follow if necessary,

Many thanks


  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Giuseppe Larosa Wed, 06/17/2009 - 04:19

Hello Jonathan,

when using two OSPF processes they run as "ships in the night" and they compete for installing prefixes in the routing table.

The first to propose a prefix wins.

We had the same issue during the integration of two providers.

This is true also for the default route.

Actually the IP routing maintainer looks only at the AD.

You need to decide a hierarchy between the two OSPF processes using the distance OSPF command that allows to modify AD for internal inter-area and external routes.

router ospf 1

distance ospf external 112

router ospf 2

distance ospf external 115



Hope to help


jonathanaxford Wed, 06/17/2009 - 05:38

Hi Guiseppe,

I had a play with the OSPF distance command after posting this and it worked perfectly! I have now assigned a different OSPF distance to the necessary OSPF process and all works like a charm.

Many thanks for the explanation, i vaguely remember "Ships in the night" routing from somewhere!




This Discussion