Dynamic routing to internet based on interface status across two routers

I have the following configuration at present.  Router A is our IP clear router on site with Router B as the internet router.  Router C is a router at our main site.

I want to route the internet out from site via router B but if the interface/ Router B fails then send traffic to X.X.X.X via router D.

I have the following config which allows the traffic out via Router C and manually removing the statement  ip route X.X.X.X B.B.B.B on router A sends the traffic down link D.  I want to know how to make the statement dynamic based on the state of router B or link A

Router A

router BGP 123

ip route X.X.X.X B.B.B.B

Router B

Ip route dialer 1

Router C

router bgp 123
network X.X.X.X mask
ip router X.X.X.X D.D.D.D
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

jmeggersConnect With a Mentor Sr. Network and Security EngineerCommented:
Try using a higher admin distance for the secondary route.  That way it will be less preferred until the primary route goes away.

network X.X.X.X mask <distance>
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
All Courses

From novice to tech pro — start learning today.