Expand all | Collapse all

Auto controlling as-path on BGP peers

  • 1.  Auto controlling as-path on BGP peers

    Posted 01-18-2021 05:57

    Here is the issue:
    We have two BGP peers, on each MX machine.
    Both BGP peers are receiving the same prefixes from the other side, but, first peer receive the prefixes without as-path, and the other one with as-path.

    We'd like to control from our side the AS-Path configured on each network advertised from the neighbor machine
    So let say the neighbor is advertising on one peer:                             65512 65512 65512 65512 I​

    And on the other peer he's advertising:                             65512 I​

    So we'd like for example to flip the as-path values between them (from our side)
    a suggested solution was to use 'communities' .. but the neighbor won't let us use this solution for security reasons ..
    Is there any suggested solution for this?

    Thanks :)

    Abed AL-Rahman Bishara

  • 2.  RE: Auto controlling as-path on BGP peers

    Posted 01-18-2021 19:59
    I''m not sure I follow your need, but I think you are saying:
    • peer A customer sends prefix with some prepended AS added
    • peer B customer sends prefix without any prepend
    • normal operation you send these on to the upstream peers
    What you want to do then is:
    • peer A remove the customer prepend and send to upstream peers
    • peer B add prepended AS  and send to upstream peers
    For removal of AS see,

    If the AS is a private one you could use remove-private

     For public AS the as-override may work for you but is not as flexible.
    To add prepending this is the example

    Naturally you need to change the policy from one to the other manually on your side.  This is why we prefer the community solution where the customer can add the community on their own and our policy can perform the requested action on demand for that community.

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