This is still another series of my learning journey about BGP…On my lab, I will be showing how to influence Inbound Traffic to an AS…The main idea here is that BGP prefers a route with a SHORTEST AS PATH….This can be accomplished by manipulating the AS Path Attribute using “AS PATH PREPENDING” command….
Here is my laboratory topology,
Here are my router configurations:
|
R1#sh run | sec bgp
ipv6 multicast rpf use-bgp router bgp 65000 bgp log-neighbor-changes neighbor 172.16.12.2 remote-as 65001 neighbor 172.16.13.3 remote-as 65001 |
|
R2#sh run | sec bgp
ipv6 multicast rpf use-bgp router bgp 65001 bgp log-neighbor-changes network 23.23.23.0 mask 255.255.255.0 neighbor 172.16.12.1 remote-as 65000 |
|
R3#sh run | sec bgp
ipv6 multicast rpf use-bgp router bgp 65001 bgp log-neighbor-changes network 23.23.23.0 mask 255.255.255.0 neighbor 172.16.13.1 remote-as 65000 |
Checking the BGP Summary.. R1 is receiving 1 Prefix each from R2 and R3…
|
R1#show ip bgp summary
BGP router identifier 172.16.13.1, local AS number 65000 BGP table version is 2, main routing table version 2 1 network entries using 144 bytes of memory 2 path entries using 160 bytes of memory 1/1 BGP path/bestpath attribute entries using 136 bytes of memory 1 BGP AS-PATH entries using 24 bytes of memory 0 BGP route-map cache entries using 0 bytes of memory 0 BGP filter-list cache entries using 0 bytes of memory BGP using 464 total bytes of memory BGP activity 1/0 prefixes, 2/0 paths, scan interval 60 secs Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd |
So R1 choose the Lowest Router ID Attribute ( R2) as all the rest are default…
|
R1#show ip bgp
BGP table version is 2, local router ID is 172.16.13.1 Status codes: s suppressed, d damped, h history, * valid, > best, i – internal, 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 valid, I invalid, N Not found Network Next Hop Metric LocPrf Weight Path |
So let me used AS PATH PREPENDING to informed R1 to used R3 to reach 23.23.23.23/24 instead
of R2…
|
We can use the following steps..
1. Create a route-map
2. Used the AS-PATH PREPEND
3. Apply under BGP process.
|
R2(config)#route-map AS-PREPENDING permit 10 R2(config-route-map)#set as-path prepend 65000 65000 65000 65000 R2(config-route-map)#exit R2(config)#router bgp 65000 R2(config)#router bgp 65001 R2(config-router)#do clear ip bgp * soft |
Now, let’s check on R1 BGP database…
|
R1#show ip bgp
BGP table version is 3, local router ID is 172.16.13.1 Status codes: s suppressed, d damped, h history, * valid, > best, i – internal, 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 valid, I invalid, N Not found Network Next Hop Metric LocPrf Weight Path |
So the routes were installed in its routing table with a path via R3…
|
R1#show ip bgp BGP table version is 3, local router ID is 172.16.13.1 Status codes: s suppressed, d damped, h history, * valid, > best, i – internal, 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 valid, I invalid, N Not found Network Next Hop Metric LocPrf Weight Path |
|
R1#ping 23.23.23.23 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 23.23.23.23, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 52/55/60 ms R1# |
| So here what I have done…I have fake the AS on my route-map with the AS-PATH PREPEND command to let R1 know that it should not select R2 path to reach 23.23.23.23/0 network…. |
*******************************END OF LAB*************************************

Leave a comment