×

Warning message

  • Cisco Support Forums is in Read Only mode while the site is being migrated.
  • Cisco Support Forums is in Read Only mode while the site is being migrated.

BGP Regular Expression Question

Answered Question
Feb 29th, 2012
User Badges:

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

Correct Answer by John Blakley about 5 years 5 months ago

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.

Correct Answer by milan.kulik about 5 years 5 months ago

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

Correct Answer by John Blakley about 5 years 5 months ago

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


HTH,

John

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (6 ratings)
Loading.
Correct Answer
John Blakley Wed, 02/29/2012 - 14:23
User Badges:
  • Purple, 4500 points or more

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


HTH,

John

Correct Answer
milan.kulik Wed, 02/29/2012 - 23:54
User Badges:
  • Red, 2250 points or more

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

Correct Answer
John Blakley Thu, 03/01/2012 - 03:39
User Badges:
  • Purple, 4500 points or more

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.

bjrogers Thu, 03/01/2012 - 06:45
User Badges:

Thanks everybody for the responses - they are much appreciated!


Brian

burleyman Thu, 03/01/2012 - 07:04
User Badges:
  • Blue, 1500 points or more

John,


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



Mike

Actions

This Discussion