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

BGP and regular expression

Hi everyone not sure if this is the right place to put this but I have a BGP statement that I'm trying to understand..it is as follows:

neighbor VNET filter-list 17 out

ip as-path access-list 17 permit ^[0-9]+$

ip as-path access-list 17 permit ^$

what is this trying to tell me?

1 ACCEPTED SOLUTION

Accepted Solutions
Silver

Re: BGP and regular expression

The ngihbor filter list command is used to filter BGP routes based on AS-Path access list. As-path access list uses regular expression to match BGP as-path.

In regular expression, ^ mathces the beginning of a string, $ matches end, + matches the preceding element 1 or more times. See

http://en.wikipedia.org/wiki/Regular_expression

ip as-path access-list 17 permit ^[0-9]+$ would therefore match a string of digits. This means an as path with a length of 1.

ip as-path access-list 17 permit ^$ would match a null string. This would mean no as-path or locally originated routes.

As the filter-list is applied outbound, only locally originated routes and routes with an as-path length of 1 would be advertised out.

See

http://www.cisco.com/warp/public/459/26.html

4 REPLIES

Re: BGP and regular expression

Hi,

I guess you have peer groups here, since you have a peer name.

it will try to tell you that you should only allow (locally originated routes) and updates from any AS number matches 0 or 1 time.

HTH

Mohamed

Silver

Re: BGP and regular expression

The ngihbor filter list command is used to filter BGP routes based on AS-Path access list. As-path access list uses regular expression to match BGP as-path.

In regular expression, ^ mathces the beginning of a string, $ matches end, + matches the preceding element 1 or more times. See

http://en.wikipedia.org/wiki/Regular_expression

ip as-path access-list 17 permit ^[0-9]+$ would therefore match a string of digits. This means an as path with a length of 1.

ip as-path access-list 17 permit ^$ would match a null string. This would mean no as-path or locally originated routes.

As the filter-list is applied outbound, only locally originated routes and routes with an as-path length of 1 would be advertised out.

See

http://www.cisco.com/warp/public/459/26.html

Re: BGP and regular expression

Hi,

The Original poster has a bgp name as neighbor which defined for peer groups:

Pls check bellow:

neighbor ((VNET)) filter-list 17 out

HTH

Mohamed

New Member

Re: BGP and regular expression

Thank you everyone for replying I will finish looking at those links

283
Views
0
Helpful
4
Replies
CreatePlease to create content