cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
680
Views
0
Helpful
4
Replies

BGP and regular expression

wgranada1
Level 1
Level 1

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

olorunloba
Level 5
Level 5

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

View solution in original post

4 Replies 4

Mohamed Sobair
Level 7
Level 7

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

olorunloba
Level 5
Level 5

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

Mohamed Sobair
Level 7
Level 7

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

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

Review Cisco Networking products for a $25 gift card