Routing

last person joined: 3 days 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.  AS Path Regular Expression for filter the route

    Posted 03-26-2011 08:34

    Hi Expert

     

    I want to make a regular expression so that routes coming from AS no 6504 should not have AS no 6501 at the end of AS path. LIKE this AS path is acceptable 6504 7171 8989 1111 BUT it should not be acceptable 6504 8989 1111 6504

     

    Bottom line is between 6504 and 6504 any AS no could be there but at the end of AS path 6504 should be there.

     

    Thanks



  • 2.  RE: AS Path Regular Expression for filter the route

    Posted 03-26-2011 08:45

    The $ indicates end of line in a regex so .*6504$ matches every thing ending with 6504. Plac this in the right policie and it should work I think.



  • 3.  RE: AS Path Regular Expression for filter the route

    Posted 03-26-2011 10:34

    route matching using .*6504 is sufficient..



  • 4.  RE: AS Path Regular Expression for filter the route

    Posted 03-26-2011 11:48

    Sorry I put the wrong question. The question should be like this my AS no is 777 and my neighbour AS no 6504. I want to match the routes coming from 6504 AS in such a manner that only routes beyond 6504 should be accepted BUT there should not be 6501 at the end.

     

    For example "6504 777 888" is acceptable BUT "6504 777 888 6501" should not be accepted.

     

    Thanks



  • 5.  RE: AS Path Regular Expression for filter the route

    Posted 03-26-2011 15:13

    So use two terms in the policy

    .*6501     reject

    .*6504.*  accept

    Final catch all term reject

     



  • 6.  RE: AS Path Regular Expression for filter the route

     
    Posted 03-26-2011 23:28

    Hi,

        You can define you import policy as below.

    policy-statement bgp-import {
        term reject_6501_origin {
            from as-path orig_6501;
            then reject;
        }
        term peer_routes {
            from as-path from_6504;
            then accept;
        }
        term other_routes {
            then reject;
        }
    }
    as-path orig_6501 ".* 6501";
    as-path from_6504 "6504 .*";


    term other_routes =====  would reject all other routes which are not coming from 6504 or don't have 6504 at the begining of AS path

    The term "other_routes" is inline to your requirement "I want to match the routes coming from 6504 AS in such a manner that only routes beyond 6504 should be accepted".

    This is only to match your specified requirement on slecting the routes based on AS path.
    Please ensure to modify the policy to meet other requirements, if any.

    Hope this helps
    If you liked this, Kudos would be appreciated.

    Regards
    Surya Prakash




  • 7.  RE: AS Path Regular Expression for filter the route

    Posted 03-28-2011 13:22

    Thanks to all But there is not any single regular expression for this task?



  • 8.  RE: AS Path Regular Expression for filter the route
    Best Answer

     
    Posted 03-29-2011 20:39

    Hi,

     

    It would have been possible with a "!" (NOT operator) and reg-ex as "6504 .* (!6501)$"

     

    Unfortunately,  "!" (Not operator) is not supported in AS path regular expression.

     

    http://www.juniper.net/techpubs/en_US/junos10.4/topics/usage-guidelines/policy-configuring-as-path-regular-expressions-to-use-as-routing-policy-match-conditions.html

     

    Regards

    Surya Prakash



  • 9.  RE: AS Path Regular Expression for filter the route

    Posted 03-30-2011 13:28

    So it means we cannot make a regualr expression tu exlude any AS no?

     

    Thanks



  • 10.  RE: AS Path Regular Expression for filter the route

     
    Posted 03-31-2011 08:55

    Hi,

     

    Yes. with regular expression I believe it is not possible.

     

    Hope this helps Smiley Happy

    If you feel this was value add, Kudos would be appreciated.

     

    Regards

    Surya



  • 11.  RE: AS Path Regular Expression for filter the route

    Posted 04-03-2011 01:27

    Thanks Surya