Routing

 View Only
last person joined: 2 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.  Filtering BGP AS-path length

    Posted 10-16-2022 13:30
    Hi!

    There was a need to filter BGP routes with a long as-path,
    like for example:

    # run show route aspath-regex ".{30,}"

    170.84.40.0/22 [BGP ] 2d 06:00:21, localpref 100
    AS path: 3255 174 16735 16735 16735 265020 265020 265020 265020 265020 265020 265020 265020 265020 265020 265020 265020 265020 265020 265020 265020 265020 265020 265020 265020 265020 265020 265020 265020 265020 265020 265020 265020 265020 265020 265020 265020 265020 265020 265020 265020 265020 265020 265020 265020 265020 265020 265020 265020 265020 265020 265020 265020 265020 265020 ?, validation-state: unverified

    200.155.136.0/22 [BGP ] 2d 05:58:32, MED 0, localpref 100
    AS path: 6939 52320 11432 11432 11432 11432 11432 11432 11432 11432 11432 11432 11432 11432 11432 11432 11432 11432 11432 11432 11432 11432 11432 11432 11432 11432 11432 11432 11432 11432 11432 11432 11432 11432 11432 11432 11432 11432 11432 11432 11432 11432 11432 11432 11432 11432 11432 I, validation-state: unverified


    I used documentation and Knowledge Base:

    One
    Two
    Three


    My config:
    set policy-options as-path too-many-hops ".{30,}"

    # show policy-options policy-statement UPSTRM-IN-v4
    term get-routes {
    from {
    as-path too-many-hops;
    prefix-list-filter deny_gt_24 orlonger;
    }
    then reject;

    Term "get-routes" - is a first term in this policy

    But the routes aren't blocked and I still see these routes

    I can't find what the problem is.


  • 2.  RE: Filtering BGP AS-path length
    Best Answer

    Posted 10-17-2022 08:42

    >170.84.40.0/22
    >200.155.136.0/22

    vs

    >prefix-list-filter deny_gt_24 orlonger;

    It's a logical AND with multiple match criteria (from).
    You didn't include the config for "deny_gt_24", but I'll take a punt that it is NOT matching those /22s, so the whole term doesn't match.




  • 3.  RE: Filtering BGP AS-path length

    Posted 10-19-2022 10:28

    Yes, you're absolutely right.

    I don't understand how I couldn't see it )))

    Thank you