2

I want to write a regex in Juniper MX960 router for BGP including 3 AS paths with first element is constant, second and third are wildcard. I found that we can put as numbers manually like this:

9121+ (one|two|three|...) (one|two|three|...)

This doesn't work for me 'cause I don't know whole as numbers in second and third level. They can be anything. I want them to be "any".

9121+ any+ any+ « I need this.

John Willemse
  • 6,608
  • 7
  • 31
  • 45
h0m3r
  • 53
  • 1
  • 11

2 Answers2

1

the exact answer may depend on the version of Junos that you are using.

However, this syntax should work:

show route aspath-regex 9121 (.*){2}

This means, match AS9121 as the first element, and then any AS number exactly two times.

Here there is a lot of good examples:

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

Saverio Proto
  • 1,085
  • 9
  • 20
-1

How about "9121 . ."? It seems to me like that may work.

ameed
  • 1,132
  • 6
  • 25
NSG
  • 1