12-01-2024 11:15 PM
Hello,
I am running a little LAB on CML 2.7.2. I have the following topology:
I am prepending a mix of public and private ASN on R2 towards R3:
and I am also using the command to remove all the private ASN from the AS-PATH attribute on routes advertised to R3. However, on R3 it only appears to be removed the ASN of R2, which is 64512. This means that the prepending command is taking place after the remove-private-as command. Is this how is it supposed to be, or is it a CML bug?
12-01-2024 11:30 PM
It override or not' there is no doc. About order BUT
You can remove prepend remote-map and check AS in R3.
If 6451x is appear in R3 then there is other restrictions of apply remove private
MHM
12-01-2024 11:38 PM - edited 12-01-2024 11:40 PM
Hello,
In the screenshots you can see that I already did what you said, because the ASN of R1 (64512) is being removed, but the prepended ones not, which means that the command is working, but not in the desired way. ( is working before prepending). I would like to know if is a CML thing or if it usually works this way.
Thanks
12-01-2024 11:42 PM
You are studying bgp and I want to give you clear views of issue.
I send you bgp restrictions in PM.
The prepend can make remove private as not work.
One of restrictions is"" remove private not work if as path have mix of private and public as""
And your prepend is do that it mix public and private AS and hence not work'
This additional to order' which come first.
So try make prepend add only private AS and check.
MHM
12-01-2024 11:58 PM
Hello MHM,
Thanks for the answer. On Cisco documentation says that using the keyword “ALL” at the end of the remove-private-as command will allow the command to work when having a mix of public and private ASes. I am using the keyword “all” in the screenshots that I sent.
Also, like I said before, you can see that the command is working for the not prepended ASN since AS 64512 is removed on R3.
I will try tomorrow to remove the public ASN from the prepend route map like you said, but even if it works it doesn’t seem to resolve the doubt.
Thanks,
Juan
12-02-2024 04:54 AM
Confirm same behave in GNS3, the route-map with as-prepned is override the remove private (see below result)
what make engineer confuse ?
which come first
from cisco doc. which I am sorry to say that it little not clear
""
A. The order of preference varies based on whether the attributes are applied for inbound updates or outbound updates.
For inbound updates the order of preference is:
route-map
filter-list
prefix-list, distribute-list
For outbound updates the order of preference is:
filter-list
route-map | unsuppress-map
advertise-map (conditional-advertisement)
prefix-list|distribute-list
ORF prefix-list (a prefix-list the neighbor sends us)
so there is no mention about as-path remove at all
BUT
you can use show ip bgp neighbor X.x.x.x
to see in which order the bgp list it and according to that you do your config
12-02-2024 06:45 AM
I know what keyword ""all"" meaning and I use it in my lab.
Result shown when I use remove command with ""all"" keyword.
MHM
12-02-2024 12:57 AM - edited 12-02-2024 03:16 AM
With "remove-private-as all, This will remove all private AS numbers.
You must be referring below link, in this example it is working as expected.Only difference is, it is prepending and advertised from R1 , and in your case you are prepending and advertising from R2. Can you check same way in the given example,
https://member.networkprofessional.net/bgp-remove-private-as-numbers/
12-02-2024 02:38 AM
Hello @JUANNN
The remove-private-as command is designed to remove private AS numbers (like 64512) from the AS-PATH attribute when advertising routes. However, this command is sensitive to the order of operations. When you're also using AS path prepending with both private and public AS numbers, the order in which these operations are applied becomes important. The remove-private-as command should ideally be applied before AS path prepending to ensure that private ASNs are removed from the path before any additional ASNs are added. Since you're seeing that only the ASN of R2 (64512) is being removed, it indicates that the prepending operation might be happening after the remove-private-as operation, causing prepended private ASNs to remain in the AS-PATH.
This behavior is expected given the restriction where the remove-private-as command may not function correctly if the AS-PATH contains a mixture of both private and public ASNs. The prepending of both private and public ASNs could be causing the issue.
So, ensure that the private ASNs are removed correctly before any prepending happens, you should modify your configuration to prepend only private ASNs, without mixing in public ASNs. This will allow the remove-private-as command to work as expected and remove the private ASNs from the path before any prepending occurs.
12-02-2024 06:40 AM
Thanks, I will try what Shambu Kumar said. Very interesting that GNS3 does the same thing. I will post the result once I try it the way Shambu mentioned, I believe is going to work that way. However, the order issue seems to be a bit more clear thanks to MHM post too. Thanks!
12-02-2024 11:15 PM - edited 12-02-2024 11:15 PM
As expected, if prepending on R1 and removing-private-as on R2, then on R3 all I see is:
I will still have to verify if in the hardware gear the order of prepending after removing-private-as is the same as in GNS3 (as MHM posted) or CML.
Thanks for the replies,
Juan
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