We have two sites that are connected to MPLS. The service provider has a PE router on site at each location. They are running BGP for our WAN which is extensive. It is private EBGP so each site has it's own ASN. We are redistributing OSPF into BGP and aggregating the private subnets at the site edge. We are using "default information-originate" on the PE router's OSPF configuration to advertise the MPLS connection as the default route for each site's core. These two sites are linked with a campus fiber and we are running another OSPF process between the two sites. The routes over this link are more specific and have a lower cost than the MPLS connection.
There is also a backup VPN over an internet link that will act as the tertiary link and also run OSPF. We will be setting the cost of that interface high so that it is a last resort.
The goals are:
Local traffic between the sites traverse the campus link
If the campus link goes down they can route to each other via MPLS
If one MPLS link is down, all the traffic goes out across the campus link to the MPLS link at the other location.
If both MPLS links go down, traffic will go out respective Backup VPN tunnels.
My question is, how can I make that default route from the local MPLS router withdraw itself from our Core (which peers with the provider edge router) if BGP goes down? Wont OSPF continue to advertise itself as the DG?
So what triggers it to stop advertising itself? How does OSPF know that it is dependent on BGP to operate properly? I'm trying to understand the actual mechanisms?