3 mins read

BGP – as-path-prepend

1. Intro

You can prepend one or more autonomous system (AS) numbers at the beginning of an AS path. The AS numbers are added at the beginning of the path after the actual AS number from which the route originates has been added to the path. Prepending an AS path makes a shorter AS path look longer and therefore less preferable to BGP.

2. Configuring as-path-prepend:

This time we will apply the configuration on the R3 router. R3 is receiving the 192.168.50.0/26 prefix and is advertising that to R2. At this point we will the as-path-prepending:

The configuration is straightforward:

3. We can prepend any number:

We will change the policy, so that we prepend some random numbers:

Any AS number can be used when prepending, as long as it is within the range 1 to 4294967295. So, watch out for typos.


External Resources: