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

Andy Litzinger andy.litzinger.lists at gmail.com
Thu Sep 12 19:18:51 EDT 2019


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


More information about the juniper-nsp mailing list