Home > CISCO > BGP Regular Expressions

BGP Regular Expressions

March 3rd, 2013

+————-+—————————+
| Expression | Meaning |
|————-+—————————|
| .* | Anything |
|————-+—————————|
| ^$ | Locally originated routes |
|————-+—————————|
| ^100_ | Learned from AS 100 |
|————-+—————————|
| _100$ | Originated in AS 100 |
|————-+—————————|
| _100_ | Any instance of AS 100 |
|————-+—————————|
| ^[0-9]+$ | Directly connected ASes |
+————-+—————————+

ip as-path access-list 1 deny ^10_ deny all the networks that have been learned from AS 10
ip as-path access-list 1 permit 195.88.228.96 mask 255.255.255.255
ip as-path access-list 1 permit 195.88.229.96 mask 255.255.255.255
ip as-path access-list 1 deny _65156$ deny all the networks that have originated from AS 65156
ip as-path access-list 1 deny .* deny all other routes

** ip as-path access-list 10 permit ^$ permit locally originated routes **

ip as-path access-list 2 deny _39173$ deny all the networks that have originated from AS 39173
ip as-path access-list 2 permit .* permit all other routes
!
ip as-path access-list 1 deny _10$ deny all the networks that have originated from AS 10
ip as-path access-list 1 permit .* permit all other routes

** ip as-path access-list 10 permit ^$ permit locally originated routes **

ip as-path access-list 2 deny _39173$ deny all the networks that have originated from AS 39173
ip as-path access-list 2 permit .* permit all other routes

Categories: CISCO Tags:
Comments are closed.