I'm working on the setup of a Cisco CSR. I have a route 10.0.0.0/24 learned by a BGP session on tunnel 200 and 201 (MPLS and failover), I also have a static route 10.0.0.0/29 (smaller than the previous one) to a tunnel 202.
I need to make the setup so when the MPLS is up the route goes through 200 or 201 but if it fails goes to 202, in case the MPLS is back up return to those tunnels.
I have done some basic tracking with SLA between two static routes /32 but I got lost when the two BGP tunnels come to play, and with the size difference between the BGP and the static routes, can somebody give me some light on this ?
The more specific route is always going to be used.
It is not clear when you say the route should go via MPLS which route you are talking about, the /24 or the /29.
If the route received by BGP and your static route had the same prefix length then you could just add an AD higher than BGP (AD 20) to your static route and it should work as expected.
Not really no because in routing the longest match always wins.
The only way you could prioritise the /24 is to make sure the /29 is not in the IP routing table which is what you may be using IP SLA for ?
Can you not make the routes the same prefix length ?
it sounds like you could possibly incorporate policy based routing to route via a certain path based on a object tracking method -this way if reachability to the tracked object becomes unreachable the routing will take the alternate path
in addition to the other posts, an EEM script that simply removes/adds the static routes based on either a syslog entry, or an IP SLA state track, could work as well. Can you post the running config of your CSR ?