AS Path Prepending on XE and XR
Last updated
Last updated
This short article explores what happens when you do AS path prepending and apply it outbound to an eBGP neighbor.
Consider the following topology:
R1 originates 10.10.10.10/32 into BGP. R2 uses the following route-map and applies it to the neighbor statement for R3 outbound:
What is the AS path for 10.10.10.10/32 as seen on R3? There are two options that might make sense:
100 65001 65000 i
65001 100 65000 i
The answer is 65001 100 65000 i. This is because the route-map is applied before the local AS is finally added to the AS path, when advertising the route to the eBGP peer.
Note that this is logic is not applicable when you change the next-hop IP address in the route-map. The router doesn’t then change this to its interface address used for the eBGP session. The next-hop that the route-map sets takes precedence.
This same logic applies when preforming AS path prepending on XR with the following route-policy:
The local AS is prepended after the RPL prepending takes place: