Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Community Member

BGP Regular Expression Question

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

BGP Regular Expression Question

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 ***

BGP Regular Expression Question

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

BGP Regular Expression Question

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 ***
5 REPLIES

BGP Regular Expression Question

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 ***

BGP Regular Expression Question

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

BGP Regular Expression Question

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 ***
Community Member

BGP Regular Expression Question

Thanks everybody for the responses - they are much appreciated!

Brian

BGP Regular Expression Question

John,

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

Mike

412
Views
15
Helpful
5
Replies
CreatePlease to create content