Fail over scenario on Mx5

‎07-16-2019 06:40 PM

Hi everyone,

Please consider the following example, both routers are MX5T

                     R1 gig1/0/1- Provider1 path---- gig1/0/1 R2

                     R2  gig 1/0/1-- Provider2 path--- gig1/0/2


Assume subnet lives behind R1 and R2..

Design goal;

R2 must use  Provider1 to reach  Only if Provider1 is down, then R2 should use Provider2 to reach

Constraint : We can not use routing protocol .

I thought about using floating static routes on R2 , but the issue is traffic can be blackholed if something happens within Provider network , the link will stay up therefore static route will continue to be used blackholing the traffic.


Unfortunately, MX5T does not support IP monitoring otherwise which would help us detect failures and install the static routes accordingly.

Is there any way I can install static route and remove static route based on RPM probe failure ?


Thanks and have a good night!!



Re: Fail over scenario on Mx5

[ Edited ]
‎07-16-2019 07:29 PM



I understand what you are trying to do. You can achieve this by configuring RPM probe to detect the reachability and then using that in event-options policy to configure/delete particular static route.


I have configured and verified this scenario in lab, please refer the attachment. please change the IPs to match your setup.


Please accept my response as solution if it solves your query!






Re: Fail over scenario on Mx5

[ Edited ]
‎07-16-2019 08:47 PM



@sarahr202 wrote:


Is there any way I can install static route and remove static route based on RPM probe failure ?





Yes,with JUNOS 18.4 and newer


Support for activating or deactivating static routes on the basis of RPM test results (MX Series)—Starting in Junos OS 18.4R1, you can use RPM probes to detect link status, and change the preferred-route state on the basis of the probe results. Tracked routes can be IPv4 or IPv6, and support a single IPv4 or IPv6 next hop. For example, RPM probes can be sent to an IP address to determine if the link is up, and if so, take the action of installing a static route in the route table . RPM-tracked routes are installed with preference 1 and thus are preferred over any existing static routes for the same prefix.




No scripting is required.





Please ask Your Juniper account team about Juniper Professional Services offerings.
Juniper PS can design, test & build the network/part of the network as per Your requirements


Accept as Solution = cool !
Accept as Solution+Kudo = You are a Star !
Accepted by topic author sarahr202
‎07-21-2019 11:40 AM

Re: Fail over scenario on Mx5

‎07-16-2019 11:26 PM

just a thought ,I  think we can do this with generated route 

Generated route will install a static route when the provider 1 in reachable ,so that every time traffic goes over it when it is reachable and withdraws the route when the provider one becomes un-reachble so that traffic can go over provider 2 .

A sample config below ( i have not tested this) :- 

[edit policy-options prefix-list MyUpstream];
[edit policy-options policy-statement IfMyUpstreamIsReachable]
term LookForUpstream {
from {
rib inet.0;
prefix-list MyUpstream;
then accept;
term NoOther {
then reject;
/* this conditionally generates the default to the routing table */
[edit routing-options]
rib inet.0 {
generate {
route 0/0 {
policy IfMyUpstreamIsReachable;





Re: Fail over scenario on Mx5

[ Edited ]
‎07-21-2019 11:38 AM

Thanks for your responses.

I also found another way to do it using static route with BFD detection.


set routing-optons static route x/y next-hop preference 1

set routing-option static route x/y bfd-detection

Then the back up with high pref:

set routing-option static route x/y next-hop 20


Only when link to x.x.x.x fails, back up route will be active, as soon as primary link comes up, traffic moves to primary.


Have a good weekend!!