In BGP configuration especially where Multihoming scenarios are used, AS prepend is one of commonly used a BGP feature which is used for path manipulation to influence the direction of the incoming traffic to an AS.
As a general understanding, AS prepend is applied only in an outbound direction to affect the incoming traffic to an AS.
Related – What is VRF
However, in this post, we will configure the AS prepend feature to IN direction and see how we can still achieve the same path manipulation as we could have achieved when AS prepend applied in OUT direction.
In this topology, on R1 we are getting the route R4 (184.108.40.206) from two routers R2 & R3. Without any traffic manipulation we see we are able to reach R4 from R1 via path R1 -> R3 -> R4.
R1#traceroute 220.127.116.11 source 18.104.22.168
We will now apply BGP AS prepend on R3 inbound to make path R1 -> R2 -> R4 the preferred path to reach router R4.
Now we have applied route-map in-prepend in inbound direction on R3 to make the AS-Path for 22.214.171.124 via R3 the longer one.
Verifying now on R1 we see the path via R2 is best and via R3 is not preferred anymore as it has longer AS-path.
Below is the Traceroute output to validate the expected output after configuration change –
Related – Interview Questions of BGP
ABOUT THE AUTHOR
I am here to share my knowledge and experience in the field of networking with the goal being – “The more you share, the more you learn.”
I am a biotechnologist by qualification and a Network Enthusiast by interest. I developed interest in networking being in the company of a passionate Network Professional, my husband.
I am a strong believer of the fact that “learning is a constant process of discovering yourself.”
– Rashmi Bhardwaj (Author/Editor)