12-30-2011 12:56 AM - edited 03-07-2019 04:06 AM
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 ??
12-30-2011 01:24 AM
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.
12-30-2011 05:04 AM
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
12-30-2011 06:33 AM
Hi Milan,
That was good to learn, thanks
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide