cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1392
Views
15
Helpful
5
Replies

BGP Regular Expression Question

bjrogers
Level 1
Level 1

To All,

Below are some regular expressions that I understand:

ip as-path access-list 1 permit ^$ - permits only locally originated BGP routes

ip as-path access-list 1 permit .* - permit any

ip as-path access-list 1 permit _65535$ - permits networks that originated in 65535

There is a regular expression I do not understand which is being utilized on a network:

ip as-path access-list 1 permit 65535$

What does it mean when the underscore is not present before 65535$ 

Any responses are welcome.

Thank You,

Brian

3 Accepted Solutions

Accepted Solutions

John Blakley
VIP Alumni
VIP Alumni

It does the same thing as your _65535$ expression does. The AS-Path has to end with 65535 (actually originate from).

HTH,

John

HTH, John *** Please rate all useful posts ***

View solution in original post

milan.kulik
Level 10
Level 10

Hi,

as John said, it's the same in your case.

But using another example:

5535$ matches also networks that originated in AS 65535

while

_5535$ does not match them.

HTH,

Milan

View solution in original post

John Blakley
VIP Alumni
VIP Alumni

As a side note, if you want to test these without trying to decode the as-path access-list commands, you can run these at the cli as well:

sh ip bgp regexp 65535$

This will show you what it will match on before doing anything that would affect traffic.

HTH, John *** Please rate all useful posts ***

View solution in original post

5 Replies 5

John Blakley
VIP Alumni
VIP Alumni

It does the same thing as your _65535$ expression does. The AS-Path has to end with 65535 (actually originate from).

HTH,

John

HTH, John *** Please rate all useful posts ***

milan.kulik
Level 10
Level 10

Hi,

as John said, it's the same in your case.

But using another example:

5535$ matches also networks that originated in AS 65535

while

_5535$ does not match them.

HTH,

Milan

John Blakley
VIP Alumni
VIP Alumni

As a side note, if you want to test these without trying to decode the as-path access-list commands, you can run these at the cli as well:

sh ip bgp regexp 65535$

This will show you what it will match on before doing anything that would affect traffic.

HTH, John *** Please rate all useful posts ***

Thanks everybody for the responses - they are much appreciated!

Brian

John,

Thanks for that command line for checking what it would match. 5+ for you...

Mike

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card