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

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

New Member

BGP- regular expression. _30$

Hello Friends,

I am currently studying regular expressions for BGP. topology is below. r6 belongs to as 30, others belong to either as10 or as 20. My purpose is to advertise routes only originated from as30 on router 6 .

router bgp 30

no synchronization

bgp log-neighbor-changes

network 30.0.0.0 mask 255.255.255.0

network 40.0.3.0 mask 255.255.255.0

network 40.0.4.0 mask 255.255.255.0

neighbor 40.0.3.3 remote-as 10

neighbor 40.0.3.3 filter-list 30 out

neighbor 40.0.4.5 remote-as 20

neighbor 40.0.4.5 filter-list 30 out

no auto-summary

!

!

ip as-path access-list 30 permit _30$

ip as-path access-list 30 deny .*

!

this is my config, but this config deny all trafic towards out direction. i can not advertise any prefix out of AS30. but i want to advertise 30.0.0.0 network or any other prefixes originated in AS30.

Can you pls advise me where i am doing wrong ??

BGP.jpg

3 REPLIES
New Member

BGP- regular expression. _30$

Hi,

I found my mistake,

correct expression must be ;

ip as-path access-list 30 permit ^$  this means  Match only routes originated from this AS

ip as-path access-list 30 deny .*

if you write;

ip as-path access-list 30 permit _30$  ---> your router doesnt recognize it cause it is in that AS so when it check as-path sequence, it doesnt recognize this as number so it passes to next expression which denies all prefixes.

BGP- regular expression. _30$

Hi,

you don't need the second line in your as-path access-list.

There's an implicit deny - the same priciple as with IP access-lists.

BR,

Milan

New Member

BGP- regular expression. _30$

Hi Milan,

That was good to learn, thanks

335
Views
0
Helpful
3
Replies