This is another BGP study notes series focusing on BGP load balancing…BGP is using attributes to influence how traffic are being received and advertise from an AS…By default, BGP are not doing load balancing but a trick can be implemented to allow B GP load balancing for a multihome BGP connections.

I will be using the below topology for my lab on this study notes..




EBGP Configs of R1:


R1#sh run | sec bgp
 router bgp 100
 bgp log-neighbor-changes
 network 1.1.1.0 mask 255.255.255.0
 neighbor 172.16.12.2 remote-as 200
 neighbor 172.16.13.3 remote-as 300

EBGP Configs of R2:

R2#sh run | sec bgp
 router bgp 200
 bgp log-neighbor-changes
 network 23.23.23.0 mask 255.255.255.0
 neighbor 172.16.12.1 remote-as 100


EBGP Configs of R3:

R3#sh run | sec bgp
 router bgp 300
 bgp log-neighbor-changes
 network 23.23.23.0 mask 255.255.255.0
 neighbor 172.16.13.1 remote-as 100



So here is the BGP neighbors:

R1#show ip bgp summary
BGP router identifier 1.1.1.1, local AS number 100
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
3/1 BGP path/bestpath attribute entries using 408 bytes of memory
2 BGP AS-PATH entries using 48 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 760 total bytes of memory
BGP activity 4/3 prefixes, 6/4 paths, scan interval 60 secs


Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
172.16.12.2     4          200       5       5        2    0    0 00:00:05        1
172.16.13.3     4          300       5       5        2    0    0 00:00:05        1

R1#

Let’s check the routes towards 23.23.23.0/24 from R1:

R1#show ip bgp
BGP table version is 2, local router ID is 1.1.1.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.12.2              0             0 200 i
 *                              172.16.13.3              0             0 300 i
R1#


NOTE: As seen, R1 would prefer to reach the network 23.23.23.0/23 via R2 as R2 has the lowest 
             router ID.

Ping is working..

R1#ping 23.23.23.23 source 1.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 23.23.23.23, timeout is 2 seconds:
Packet sent with a source address of 1.1.1.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 48/57/68 ms

R1#


Now, let me apply two important commands to allow BGP LOAD BALANCING from R1 to reach 23.23.23.0/24…

R1(config)#router bgp 100
R1(config-router)#bgp bestpath as-path multipath-relax
R1(config-router)#maximum-paths 2


R1(config-router)#^Z
R1#clear
*Oct 22 11:29:19.111: %SYS-5-CONFIG_I: Configured from console by console
R1#clear ip bgp *
R1#
*Oct 22 11:29:22.187: %BGP-5-ADJCHANGE: neighbor 172.16.12.2 Down User reset
*Oct 22 11:29:22.191: %BGP_SESSION-5-ADJCHANGE: neighbor 172.16.12.2 IPv4 Unicast topology base removed from session  User reset
*Oct 22 11:29:22.195: %BGP-5-ADJCHANGE: neighbor 172.16.13.3 Down User reset
*Oct 22 11:29:22.199: %BGP_SESSION-5-ADJCHANGE: neighbor 172.16.13.3 IPv4 Unicast topology base removed from session  User reset
*Oct 22 11:29:22.619: %BGP-5-ADJCHANGE: neighbor 172.16.12.2 Up
*Oct 22 11:29:22.883: %BGP-5-ADJCHANGE: neighbor 172.16.13.3 Up

R1#


Now, let’s check the routes from R1 towards 23.23.23.0/24…

R1#sh ip bgp
BGP table version is 3, local router ID is 1.1.1.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
 *>  1.1.1.0/24           0.0.0.0                  0         32768 i
 *m  23.23.23.0/24    172.16.13.3              0             0 300 i
 *>                            172.16.12.2              0             0 200 i
R1#



The BGP database tells us that the Prefix 23.23.23.0/24 is a multipath..


R1#show ip route bgp
Codes: L – local, C – connected, S – static, R – RIP, M – mobile, B – BGP
       D – EIGRP, EX – EIGRP external, O – OSPF, IA – OSPF inter area
       N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2
       E1 – OSPF external type 1, E2 – OSPF external type 2
       i – IS-IS, su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2
       ia – IS-IS inter area, * – candidate default, U – per-user static route
       o – ODR, P – periodic downloaded static route, H – NHRP, l – LISP
       + – replicated route, % – next hop override

Gateway of last resort is not set

      23.0.0.0/24 is subnetted, 1 subnets
B        23.23.23.0 [20/0] via 172.16.13.3, 00:02:03
                            [20/0] via 172.16.12.2, 00:02:03

R1#

*** We can see above that the prefix is reachable via the R3 and R2…

Let’s try to ping now…


R1#ping 23.23.23.23 source 1.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 23.23.23.23, timeout is 2 seconds:
Packet sent with a source address of 1.1.1.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 32/44/56 ms

R1#




**************************** END OF LAB ****************************************























Leave a comment

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