[j-nsp] Help with BGP as-path regex

Alexander Arseniev arseniev at btinternet.com
Fri Sep 13 00:20:50 EDT 2019


Hello,

Does this help?

https://www.juniper.net/documentation/en_US/junos/information-products/topic-collections/release-notes/16.1/m-mx-t-series-toc.html 
<https://www.juniper.net/documentation/en_US/junos/information-products/topic-collections/release-notes/16.1/m-mx-t-series-toc.html#jd0e11155>

Support for unique AS path count ( MX Series)—Starting with Junos OS 
Release 16.1R4, you can configure a routing policy to determine the 
number of unique autonomous systems (ASs) present in the AS path. The 
unique AS path count helps determine whether a given AS is present in 
the AS path multiple times, typically as prepended ASs. In earlier Junos 
releases it was not possible to implement this counting behavior using 
theas-pathregular expression policy. This feature permits the user to 
configure a policy based on the number of AS hops between the route 
originator and receiver. This feature ignores ASs in theas-paththat are 
confederation ASs, such asconfed_seqandconfed_set.

To configure AS path count, include theas-path-unique-countcount(equal | 
orhigher | orlower)configuration statement at the[edit policy-options 
policy-statementpolicy_namefrom]hierarchy level.


Thanks

Alex


On 13/09/2019 00:18, Andy Litzinger wrote:
> Hi All,
>    I thought this would be in a cookbook somewhere but I can't find it.  Is
> there a way to write an as-path regex so it will match a providers ASN
> (e.g. 1234) one or more times and then 1 or 2 more ASNs zero or more
> times?  I'm hoping to be able to account for AS prepending.
>
> I'm an Enterprise network and one of my upstream ISPs is sending me full
> routes + default.  I want to filter the routes down to networks that are
> directly connected or at most 2 hops away from my ISP, but also allow for
> AS prepending.  It's the prepending that is tripping me up or else I think
> this would suffice:  "^1234+ .{0,2}"
>
> I think with cisco you can do this with backreferences, but Junos doesn't
> seem to support those.
>
> TIA,
>   -andy
> _______________________________________________
> juniper-nsp mailing list juniper-nsp at puck.nether.net
> https://puck.nether.net/mailman/listinfo/juniper-nsp


More information about the juniper-nsp mailing list