cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 
cancel
274
Views
1
Helpful
7
Replies

AS Path and prepend

Wan_Whisperer
Level 1
Level 1

Please help me understand what the underlined command is dong.

ip as-path access-list 20 permit ^$

router bgp XXX
bgp log-neighbor-changes
network 151.101.XXX.0 mask 255.255.255.0
neighbor 64.94.0.XXX remote-as XXXX
neighbor 64.94.0.XXX send-community
neighbor 64.94.0.XXX soft-reconfiguration inbound
neighbor 64.94.0.XXX route-map Route_Control out

access-list 100 permit 151.101.XXX.0 0.0.0.255

route-map Route_Control permit 10
match ip **bleep** 100
!
route-map Route_Control permit 20 
match as-path 20

 

I did not include all the confige's,  Would the match as-path 20 have anything with sending prepend's?  If not with is its propose?

 

I understand using match as-path in a route-map entering my network to filter networks by AS but I do not understand it use with a route-map exiting, especially the blanket ^$ expression 

 

Thanks 

 

 

1 Accepted Solution

Accepted Solutions

^$ meaning local originate before add any AS 
^AS$ meaning match prefix start with AS, BUT you missing that the router add it AS (local) when it forward prefix and after route-map not before and hence all prefix will not advertise because all prefix not match this condition 

Screenshot (476).pngScreenshot (477).pngScreenshot (478).pngScreenshot (479).png

MHM

View solution in original post

7 Replies 7

There is no as prepend at all' 

Your router have many prefix with multi path' and it will send out only the prefix match acl OR match as-path 20.

MHM

NHM,

I excluded the prepend config.  I understand that "it will send out only the prefix match acl OR match as-path 20" but with it using ^$ it will match everything.

Will it not send any advertisement out at all without the match as-path 20?

No friend 

^$ is regex of as-path of prefix local originate in AS 

https://ine.com/blog/2008-01-06-understanding-bgp-regular-expressions

MHM

100% understand the use of ^$ and how ^$ works.  I don't understand its use in the configs I listed in my original posting.  

it use  to prevent your router to be AS transit 
if you allow all prefix then your router will forward traffic between AS 

and that not good 

so we add this filter to make router advertise only local prefix

MHM

NHM, 

Got ya! I totally understand that.  In that case would ^$ still allow all prefixes?  In the case of only allowing my local prefixes wouldn't I need to modify the statement from

^$

to

^(my AS)$

 

From my understanding ^$ is a wild card allowing all

^$ meaning local originate before add any AS 
^AS$ meaning match prefix start with AS, BUT you missing that the router add it AS (local) when it forward prefix and after route-map not before and hence all prefix will not advertise because all prefix not match this condition 

Screenshot (476).pngScreenshot (477).pngScreenshot (478).pngScreenshot (479).png

MHM

Review Cisco Networking for a $25 gift card