BGP Remove Private AS

Hello Chandrasekhar

The truth is I wasn’t clear in my explanation, and actually, I think I mislead you, and I apologize for that. Let’s look at your topology again:

R1(AS 65530)->R2(AS 65531)->R3(AS 2) → R4 (AS 65533) → R5(AS 4)-> R6(AS5)

and the command you issued on R3:

R3(config-router)#neighbor 191.168.1.2 remove-private-as all replace-as

The restriction as stated by Cisco is the following:

If the AS path contained the AS number of the eBGP neighbor, the private AS numbers would not be removed.

Applied to your topology, the restriction states that if the AS of R4 is contained within the AS path being advertised by R3, then the private AS numbers are not to be removed. So if 65533 exists in the AS path being advertised by R3 (which is 65530 65531 2), then the private AS’es will not be removed. But it does not exist in the AS path, so the private AS’es are removed (specifically 65530 and 65531 are removed) and the result is 0 4 65533 2 2 2 i. Note that the private AS 65533 is added by R4, so it is not subject to the command that was applied in R3.

So in your example, the restriction isn’t being triggered.

Still if it was, this restriction is no longer there in newer IOS versions as stated in the previous post.

I hope this has been helpful!

Laz