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:
OneTwoThreeMy 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.