cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
652
Views
5
Helpful
4
Replies

query regarding bgp as path access list needs to check

ip as-path access-list EMEA permit 652.._[1-5]... any
ip as-path access-list EMEA permit 652.._6[0-3]... any
ip as-path access-list EMEA permit 652.._64[0-4].. any
ip as-path access-list EMEA permit 652.._6450[0-9] any
ip as-path access-list EMEA permit 652.._6451[0-1] any
ip as-path access-list EMEA permit 65205_64553 any
ip as-path access-list EMEA-ORGINATED permit _652..$ any

 

can some one explain these as-path

4 Replies 4

balaji.bandi
Hall of Fame
Hall of Fame

This regex-based ACL to Permit - so you need to understand the regex-

 

https://networklessons.com/bgp/bgp-regular-expressions-examples

 

how that work here is a good document to start :

 

https://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/13754-26.html

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello @HARISH KUMAR KANSAL ,

at first sight this as-path ACL is wrong there is no any keyword in regular expression .

 

There are some special characters that describe the AS path attribute as a sequence of strings.

^  this is the beginning of the AS path attribute

$ this is the end of the AS path attribute

these are called anchors

 

The _ is a concatenation operator and allows to describe a sequence of two AS numbers.

 

Then there are special characters that can be seen as "wildcard"

 

ip as-path access-list EMEA permit 652.._[1-5]..

 

This means match any AS path containing    the sequence of AS numbers 652xy  3zk

 

The dot should match a single character whatever ( a digit in our case ) to be noted [1-5]  means that the second AS number starts with a digit between 1 and 5 this is called a range.

To be noted the absence of anchors allows to match in any position not only at the beginning or near the end

 

Last line offers an example of matching on the last AS number

ip as-path access-list EMEA-ORGINATED permit _652..$

means match any AS path where the last AS number (thre rightmost)  is starting with 652 followed by other two digits.

 

Note:

the usage of metacharacter dot '.'  has to be verified but you should have got an idea

 

Hope to help

Giuseppe

 

Hello,

 

good question. The syntax looks a bit unfamiliar. What device is this configured on ? Could be a non-Cisco device ?

Hello
Just like to add you can test the output of regular expressions with the following commands, its a good way to test without deploying the filters.


Example:
sh ip bgp regexp _652..$  <-  this will test the bgp expression
sh ip bgp quote-regexp  “_652..$” | inc
 65   <- this will test the bgp expression but also you could pipe to specific detail of the output


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul
Review Cisco Networking for a $25 gift card