- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2024 08:31 AM - edited 05-21-2024 08:35 AM
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
Solved! Go to Solution.
- Labels:
-
WAN
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2024 09:38 AM
^$ 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
MHM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2024 08:35 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2024 08:38 AM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2024 08:41 AM - edited 05-21-2024 08:43 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2024 09:06 AM
100% understand the use of ^$ and how ^$ works. I don't understand its use in the configs I listed in my original posting.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2024 09:12 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2024 09:20 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2024 09:38 AM
^$ 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
MHM
