OSPF with Default Route

Hello,
I'm having some trouble managing the default with OSPF.

Case:
I want to distribute two default routes to my core routers, one primary and one backup, without risking loops.
I installed a static route on both edge routers and configured OSPF to distribute it.
Each core router receives its own route from the connected edge router.
I have no idea how to perform the additional exchange to have two default routes with different metrics between the core routers.
I tried filters, but nothing worked, nor did I generate one by altering the metric with ospf-ext-metric.
Any suggestions?
From what I've seen, it's a classic pattern for a core situation.
Thanks so much for any suggestions.

HI

OSPF does not support "best candidate" routes. When current active route is withdrawn from LSDB, tree calculation begins from scratch to elect new active route for given destination.

Please refer to RFC2328 section 16 for more details.

UPD Basically, you need RFC5286 section 6.3, but it's not on the list

Thanks for your reply.
So, how could I solve my scenario? Let me explain: The two core routers (even though this part isn't visible in the diagram) are connected to two routers that use eBGP and iBGP Full Mesh between them for the edge portion of my AS.
I wanted to use OSPF to distribute two defaults across my entire OSPF network, thus managing redundancy... but I think I'm on the wrong track. Do you know of a proven approach or any guides I can refer to?


This is the complete diagram, I also opened another dedicated topic for some tips but with little success

Once again, OSPF does not support alternative route. That's how this protocol works and there is no way to overcome that limitation. (except LFA FRR which is not supported in ROS). You can advertise both defaults at once via ECMP, but that's obviously not a good idea.

However, if both of your ABRs are advertising defaults, it just means that if one becomes unavailable, OSPF would immediately recalculate the tree and obtain another route.

Now according to your scheme: usually, 2 core routers and 2 ABRs are to be connected in full mesh (so core1 should be connected to ABR 2 and core2 to ABR1 as well)
Once that settled, you just use VRRP between two ARBs and advertise default pointing towards VRRP address.

PS I feel like adding some remarks to the scheme you just provided:
Unfortunately, no details or configs are applied, so I would make quite a few assumptions here, so don't take the following literally.

In this scheme as it is, assuming that all interface costs are equal, your Core1 would have def route from ABR1, while Core2 - from ABR2. If one of ABRs fail, it's nearest Core would obtain def from another ABR through it's core neighbor. So in some sense, you already have redundancy and even balancing.
The other question however, is what exactly happening later on, which is not featured on the scheme.

Generally, there are 2 possible approaches in this case:

  1. you split your whole network in two, allowing concurrent def routes for different segments (with fail-over to the other half, of course)
  2. you aggregate your network core effectively making your ABRs and Cores to appear as one for the data plane, which would involve VRRP, M-LAG, ECMP, and potentially other types of aggregation and balancing.

2nd way is much more common, but, ad already mentioned above, you would need full mesh between units among the aggregated part of the network.

PPS - in regards to BGP part - please provide more details if you are looking for an advice.