...
Operator | Description | Example | Example Explained | Example Matches |
---|---|---|---|---|
^ | Represents the beginning of the path | ^1234 | will math AS-path starting with ASN 1234 | |
$ | Represents the end of the path | 1234$ | will match AS-path of origin ASN 1234 | |
* | Zero or more occurrences of the listed ASN | ^1234*$ | will math Null as-path or as-path where ASN 1234 may or may not appear multiple times | Math: 1234 1234 1234 1234 Null path No Match: 1234 5678 |
+ | One or more occurrences of the listed ASN | 1234+ | will match AS-path where ASN 1234 appears at least once | Match: 1234 3 1234 6 No match: 12345 678 |
? | Zero or one occurrence of the listed ASN | ^1234? 5678 | will match AS-path that may or may not start with ASN 1234 appearing once. | Match: 5678 1234 5678 No match: 1234 1234 5678 12345 5678 |
. | One occurrence of any ASN | ^.$ | will match any AS-path with the length of one. | Match: 12345 45678 No match: 1234 5678 |
| | Match one of two ASNs on each side | ^(1234|5678) | will match AS-path starting with ASN 1234 or 5678 | Match: 1234 5678 1234 5678 No Match: 91011 |
[ ] [^ ] | Represents the set of AS numbers where one AS number from the list must match. Use ^ after opening the bracket to negate the set. It is also possible to reference the pre-defined num-lists from num-list with [[:numset_name:]] | ^[1234 5678 1-100] | will match the AS-path that starts with 1234 or 5678 or from the range of 1 to 100 | Match: 1234 99 5678 No Match: 101 |
() | Group of regexp terms to match | ^(1234$|5678) | will match AS-path that starts and ends with 1234 or AS-path that starts with 5678 | Match: 1234 5678 9999 No Match: 1234 5678 |
Note |
---|
Repetition ranges {} are not supported. |
Community and Num Lists
A list of commonly used numbers can be configured from the /routing/filter/num-list
menu. These lists of numbers can be used in the filter rules to simplify the filter setup process.
...