Junos OS

 View Only
last person joined: 19 hours ago 

Ask questions and share experiences about Junos OS.
  • 1.  Change Community Advertise to backup ISP upon failover

    Posted 01-08-2022 05:51
    I've got a customer that wants to use local preference community string out to Cogent to force that to be their backup inbound traffic direction; however, they want to dynamically change this local preference if a failure is detected in their primary ISP Lumen.

    Is there a way in configuration, or script to automate the changing of the BGP community string advertisement out to Cogent?

    Also if you have any examples of the failure detection used in primary ISP.

    2 MX 204's at edge

    MX204-1 has primary and secondary eBGP links to lumen
    MX204-2 has single eBGP connection to Cogent
    IBGP running between the two MX204's.


  • 2.  RE: Change Community Advertise to backup ISP upon failover

    Posted 01-08-2022 06:25
    Just to get it on the record, I assume you know that the cogent route would become active even at lower preference after your primary peer goes down.  It would take a couple minutes as the peer doing down will withdraw the primary route from Lumen after 90 seconds or faster if BFD is on that link.  From there the route withdrawal update would go to their peers like cogent.  And then the lower pref is active with no action needed.

    There is no built in feature for the process to change policy with a bgp failure event.  So you will need to setup the following.

    * detect the lumen peer down
    * change and commit the new cogent policy
    * detect the lumen peer restore
    * change and commit the original cogent policy

    So this will be an automation project.  The detect phases would use event scripts.  You will look for the specific bgp up/down messages in the log for the and use them to trigger your script.  This will require some care.  When a bgp peer is down it will cycle through a multiple message attempt to re-establish the peer and you won't want your triggered script running all the time attempting to change the status and your script running all the time during an outage.  

    Another option is to pick an interval like every 5 minutes and check the peer status.  But this is really no better than the default actions I noted above.  So finding the singular reliable trigger event will be important.


    After that you can use a python on box script to do your configuration change and commit.  Junos 18 or greater is required for this and with version 20.2 you get python 3 with more features.


    Steve Puluka BSEET - Juniper Ambassador
    IP Architect - DQE Communications Pittsburgh, PA (Metro Ethernet & ISP)

  • 3.  RE: Change Community Advertise to backup ISP upon failover

    Posted 01-16-2022 15:08
    If your customer has an IP space big enough (at least /23), you could simplify your life and just advertise superblocks to Cogent and smaller subnets to Lumen. As long as Cogent will receive the smaller subnets from Lumen, they will prefer them over the superblocks the receive directly from your customer. 

    1 x /23 -> Cogent
    2 x /24 -> Lumen