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
172.16.12.2     4        65001      10       9        2    0    0 00:04:50        1
172.16.13.3     4        65001       9       9        2    0    0 00:03:54        1
R1#


    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
 *   23.23.23.0/24     172.16.13.3              0             0 65001 i
 *>                            172.16.12.2              0             0 65001 i


  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)#neighbor 172.16.12.1 route-map AS-PREPENDING out
R2(config-router)#

R2(config-router)#do clear ip bgp * soft
R2(config-router)#^Z
R2#

 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
 *>  23.23.23.0/24    172.16.13.3              0             0 65001 i
R1#

 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
 *>  23.23.23.0/24    172.16.13.3              0             0 65001 i



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

Previous Post
Next Post

Quote of the week

"People ask me what I do in the winter when there's no baseball. I'll tell you what I do. I stare out the window and wait for spring."

~ Rogers Hornsby