In BGP configuration particularly the place Multihoming situations are used, AS prepend is one among generally used a BGP function which is used for path manipulation to affect the course of the incoming visitors to an AS.
As a normal understanding, AS prepend is utilized solely in an outbound course to have an effect on the incoming visitors to an AS.
Associated – What’s VRF
Nonetheless, on this submit, we are going to configure the AS prepend function to IN course and see how we will nonetheless obtain the identical path manipulation as we might have achieved when AS prepend utilized in OUT course.
Topology
On this topology, on R1 we’re getting the route R4 (9.9.0.4) from two routers R2 & R3. With none visitors manipulation we see we’re in a position to attain R4 from R1 by way of path R1 -> R3 -> R4.
R1#traceroute 9.9.0.4 supply 9.9.0.1
Tracing the path to 9.9.0.4
VRF data: (vrf in identify/id, vrf out identify/id)
1 9.9.13.3 92 msec 28 msec 16 msec
2 9.9.34.4 32 msec 64 msec 52 msec
We are going to now apply BGP AS prepend on R3 inbound to make path R1 -> R2 -> R4 the popular path to achieve router R4.
set as-path prepend last-as 2
router bgp 100
bgp log-neighbor-changes
neighbor 9.9.0.1 remote-as 100
neighbor 9.9.0.1 update-source Loopback0
neighbor 9.9.0.1 next-hop-self
neighbor 9.9.34.4 remote-as 200
neighbor 9.9.34.4 route-map in-prepend in
Now we’ve utilized route-map in-prepend in inbound course on R3 to make the AS-Path for 9.9.0.4 by way of R3 the longer one.
Verifying now on R1 we see the trail by way of R2 is greatest and by way of R3 just isn’t most well-liked anymore because it has longer AS-path.
BGP desk model is 3, native router ID is 9.9.0.1
Standing codes: s suppressed, d damped, h historical past, * legitimate, > greatest, i – inside,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i – IGP, e – EGP, ? – incomplete
RPKI validation codes: V legitimate, I invalid, N Not discovered
Community Subsequent Hop Metric LocPrf Weight Path
*> 9.9.0.1/32 0.0.0.0 0 32768 i
* i 9.9.0.4/32 9.9.0.3 0 100 0 200 200 200 i
*>i 9.9.0.2 0 100 0 200 i <Greatest Path by way of R2>
Beneath is the Traceroute output to validate the anticipated output after configuration change –
Sort escape sequence to abort.
Tracing the path to 9.9.0.4
VRF data: (vrf in identify/id, vrf out identify/id)
1 9.9.12.2 76 msec 36 msec 32 msec
2 9.9.24.4 44 msec 88 msec 48 msec
Associated – Interview Questions of BGP