2/10/2015

BGP Load Balancing

BGP Load Balancing

From R1, you want to BGP load balance out to R2, R3.

In order to do BGP load balancing, the route selection must be the same up to 5.5.  I had thought it was at 8.5, but after testing, it's at 5.5.

1 Weight
2 Local pref
3 Self-originated next hop = 0.0.0.0)
4 AS Path
5 Origin i, then, e, then, ?

5.5   --note:  When "bgp bestpath as-path multipath-relax" is used, it's actually at this point it will load balance when above 3 are the same.  Not anything else below.  Any else below don't matter.  If above 5 are the same for that route, it will load balance when do a "show ip route" will see 2 routes there.

6 Med (metric)
7 external ebgp over igp
8 IGP cost

8.5  --Max Path Checks -- If all above are the same for a route with multiexit points, will load balance. Put in routing table.  Will see 2 routes in "sh ip ro", then you know it's load balanced.

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

9 Ebgp peering -older routes better
10 rid lower

R1#sh run | s bgp

router bgp 1
 no synchronization
 bgp log-neighbor-changes
 bgp bestpath as-path multipath-relax
 network 1.1.1.1 mask 255.255.255.255
 neighbor 192.168.12.2 remote-as 2
 neighbor 192.168.12.2 soft-reconfiguration inbound
 neighbor 192.168.12.2 route-map SET-MED-ASPATH in
 neighbor 192.168.13.3 remote-as 3
 neighbor 192.168.13.3 route-map SET-ORIGIN-IGP in
 maximum-paths 2
 no auto-summary

=====

R1#sh ip bgp
            m multipath,

Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 1.1.1.1/32       0.0.0.0                  0         32768 i
*m 5.5.5.5/32       192.168.12.2           999           0 2 2 5 i
*>                         192.168.13.3             3             0 3 4 5 i
R1#

R1#sh ip route
Gateway of last resort is not set

      1.0.0.0/32 is subnetted, 1 subnets
C        1.1.1.1 is directly connected, Loopback0
      5.0.0.0/32 is subnetted, 1 subnets
B        5.5.5.5 [20/999] via 192.168.13.3, 03:14:22
                 [20/999] via 192.168.12.2, 03:14:22
      192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.12.0/24 is directly connected, FastEthernet0/1
L        192.168.12.1/32 is directly connected, FastEthernet0/1
      192.168.13.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.13.0/24 is directly connected, FastEthernet0/0
L        192.168.13.1/32 is directly connected, FastEthernet0/0
R1#