Showing results for 
Search instead for 
Did you mean: 

SLA - BGP and static route

Hello Community,


I'm working on the setup of a Cisco CSR. I have a route learned by a BGP session on tunnel 200 and 201 (MPLS and failover), I also have a static route (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 ?


Thanks !



Jon Marshall
VIP Community Legend


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. 



Hi Jon ! thanks for the response


The MPLS route is the /24, the /29 is the static route. Is there a way so I can give priority to the /24 ?

Jon Marshall
VIP Community Legend


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 

kind regards

Please rate and mark posts accordingly if you have found any of the information provided useful.
It will hopefully assist others with similar issues in the future
Georg Pauwen
VIP Expert



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 ?