...
The latter method is much faster and less resource-intensive than the string matching approach.
Supported operators:
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 |
- | Represents the range | |||
? | 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 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 | ^[1234 5678 1-100] | will match 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 |
Code Block | ||||
---|---|---|---|---|
| ||||
[matcher] (all can be prefixed with 'not' to negate bgp-communities|bgp-communities-ext|bgp-communities-large equal|any|includes|subset {inline set} equal-set|any-set|includes-set|subset-set {set name} any-regexp|subset-regexp {regexp} comment text|find|regexp {string} chain {chain name} vrf {vrf} rtab {rtab} gw-interface {interface} gw-check none|arp|icmp|bfd|bfd-mh afi ipv4|ipv6|l2vpn|l2vpn-cisco|vpnv4|vpnv6 ,... protocol connected|static|bgp|ospf|rip|dhcp|fantasy|modem|vpn ,... bpg-origin igp|egp|incomplete ,... bgp-as-path {regexp} rpki valid|invalid|unknown ospf-type intra|inter|ext1|ext2|nssa1|nssa2 ospf-ext-type type1|type2 [num prop readable] in {int..int}|{int-int} ==|!=|<=|>=|<|> {int} [num prop readable] [prfx prop readable] !=|==|in {address 46/} [flag prop readable] [block] if ([matcher] &&/|| ...) { [block] } [ else {[block]} ] accept|reject|return jump {chain name} unset pref-src|bgp-med|bgp-out-med|bgp-local-pref append comment {string} bgp-communities|bgp-communities-ext|bgp-communities-large {inline community set}|{set name} filter bgp-communities|bgp-communities-ext|bgp-communities-large regexp {regexp} {inline community set}|{set name} delete bgp-communities regexp {regexp} {inline community set}|{set name} wk|other ,... bgp-communities-ext regexp {regexp} {inline community set}|{set name} rt|soo|other ,... bgp-communities-large regexp {regexp} {inline community set}|{set name} all set [num prop writable] [+|-][num prop readable]|[num prop writable] gw {address 46i} gw-interface {interface} gw-check none|arp|icmp|bfd|bfd-mh pref-src {address 46} bgp-origin igp|egp|incomplete ospf-ext-fwd {address 46} ospf-ext-type type1|type2 comment {string} bgp-communities {inline community set}|{set name} bgp-communities-ext {inline community set}|{set name} bgp-communities-large {inline community set}|{set name} rpki-verify {rpki group name} |
...