04-05-2025 12:47 PM
Hello
We currently peer with our ISP using BGP, In our BGP statement we are using route-map the route-map calls an acl which contains our subnets this is working fine, If I want to AS prepend one of our subnets would I need to remove it from the acl that the route-map refrences ? and also what should the route-map look like with an acl statement and an AS prepend statement please.??
Thanks
Solved! Go to Solution.
04-05-2025 01:12 PM - edited 04-05-2025 01:28 PM
Hi @N3om ,
You would insert the AS path prepend instance before the current route-map instance:
route-map <route-map name> permit <instance number lower than the one currently in your route-map>
match ip address <new ACL number for the specific subnet(s)>
set as-path prepend xxx
route-map <route-map name> permit <current instance number>
match ip address <current ACL number>
04-07-2025 03:44 AM
@Harold Ritter Hi that worked I just tested in my lab thanks for your advise, looks like another user has accepted as solution so I cant do that.
Thankyou
04-05-2025 01:08 PM
@N3om take a look at the below doc, got some good examples
04-05-2025 01:12 PM - edited 04-05-2025 01:28 PM
Hi @N3om ,
You would insert the AS path prepend instance before the current route-map instance:
route-map <route-map name> permit <instance number lower than the one currently in your route-map>
match ip address <new ACL number for the specific subnet(s)>
set as-path prepend xxx
route-map <route-map name> permit <current instance number>
match ip address <current ACL number>
04-07-2025 03:44 AM
@Harold Ritter Hi that worked I just tested in my lab thanks for your advise, looks like another user has accepted as solution so I cant do that.
Thankyou
04-07-2025 04:37 AM
You are very welcome @N3om and thanks for the feedback
04-05-2025 01:22 PM
Hello @N3om
You can achieve AS prepending by creating multiple route-map statements with different sequence numbers. In your case, you would create a specific route-map entry that matche the subnet you want to prepend and apply the set as-path prepend command there. Then, in a separate entry with a higher sequence number, you can match the other subnets that you do not wish to prepend and allow them through without modification.
So, the BGP process will evaluate the rout-map entries in order, and the first match will apply.
This approach gives you fine control over how each subnet is advertised to your ISP without removing or change existing ACL or prefix-lists entirely...
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