cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
649
Views
0
Helpful
3
Replies

BGP- regular expression. _30$

enderkaran
Level 1
Level 1

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 3

enderkaran
Level 1
Level 1

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.

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

Hi Milan,

That was good to learn, thanks

Review Cisco Networking products for a $25 gift card