Routing

last person joined: 18 hours ago 

Ask questions and share experiences about ACX Series, CTP Series, MX Series, PTX Series, SSR Series, JRR Series, and all things routing, including portfolios and protocols.
  • 1.  Configuring multiple prepend AS path for BGP

    Posted 12-11-2016 07:41

    I have multiple AS path to prepend depending on the IP address matched in my prefix list.

    The idea is to match incoming IP addresses against my prefix list and prepend the AS number accordingly. I have done a quick search online for BGP prepend samples but i am not certain how it should be when there is multiple values involved. 

     

    Please advise if i am on the right track.

    This is what I have as of now.

     

    prefix-list normal-as-path {
    100.66.11.220/32;
    100.66.11.221/32;
    111.102.0.22/32;
    111.101.145.220/32;
    100.66.11.92/28;
    }
    prefix-list long-as-path {
    200.12.111.123/28;
    }

     

    term prependterm1 {
    from {
    prefix-list long-as-path;
    }
    then {
    as-path-prepend "65 65 65";
    accept;
    }
    }
    term prependterm2 {
    from {
    prefix-list normal-as-path;
    }
    then accept;
    }

     

    group prependpolicy {
    type external;
    import prependpolicy;
    }


    #BGP
    #JUNOS
    #prepend


  • 2.  RE: Configuring multiple prepend AS path for BGP

    Posted 12-11-2016 10:54

    I assume the two terms you list are part of the prependpolicy applied to the group prependpolicy.

     

    When you have multiple terms they are applied in order to the routes on a first match basis.  And the default policy is to simply accept a route.  

     

    So in your policy there is no possible overlap and order does not matter.  Since you have no final reject term all other routes are also accepted so if you do want ot limit the peer to only the prefix lists you need to add the final reject term.



  • 3.  RE: Configuring multiple prepend AS path for BGP

    Posted 12-11-2016 16:15

    Hey thanks for getting back to me.

     

    I am not certain if i can have 2 different prepend function in a single policy function. Am pretty new to L3 routing for Junos. 

    Noted for the default behaviour. I will add a deny statement at the end. 

     

    Cheers mate. 



  • 4.  RE: Configuring multiple prepend AS path for BGP

    Posted 12-12-2016 02:53

    Yes, you can have two different prepend operations in the same policy.  Naturally the terms would need to be written such that hitting they affect different prefixes.

     

    A common use case for this would be having multiple prepend communities.  When the downstream peer adds the desired community then the requested number of AS prepend occur when passing the prefix upstream.  So the client can choose how many prepends occur.