ccie blog

BGP Basic Load Sharing

We are going to use the diagram below to configure basic load balancing.  The most simple way to achieve load balancing in this scenario is by peering between AS’s using a loopback address.  With eBGP peers, it’s most common to use physical interfaces between AS’s to peer.  This is because when an interface goes down, you generally want the BGP session to drop.  However when using load sharing, in this type of situation, we want to peer using loopbacks.

The configuration is pretty straight forward.  The goal is to ensure we load balance traffic into and out of AS1 using both links.

//R1's config
router bgp 1
 no synchronization
 bgp log-neighbor-changes
 network 100.100.100.100 mask 255.255.255.255
 neighbor 2.2.2.2 remote-as 2
 neighbor 2.2.2.2 ebgp-multihop 2
 neighbor 2.2.2.2 update-source Loopback0
 maximum-paths 2
 no auto-summary
!
ip route 2.2.2.2 255.255.255.255 FastEthernet0/1 21.21.21.2
ip route 2.2.2.2 255.255.255.255 FastEthernet0/0 12.12.12.2
//R2's config
router bgp 2
 no synchronization
 bgp log-neighbor-changes
 neighbor 1.1.1.1 remote-as 1
 neighbor 1.1.1.1 ebgp-multihop 2
 neighbor 1.1.1.1 update-source Loopback0
 no auto-summary
!
ip route 1.1.1.1 255.255.255.255 FastEthernet0/1 21.21.21.1
ip route 1.1.1.1 255.255.255.255 FastEthernet0/0 12.12.12.1

There is really nothing complicated.  By enabling ebgp-multihop we allow our peer to be two hops away (required when peering using loopbacks).  The two static routes allow prefixes received from either neighbor to be load shared between the two links.  We can verify this by checking the routing table and doing a traceroute.

R2#sh ip route | b Gate
Gateway of last resort is not set

     1.0.0.0/32 is subnetted, 1 subnets
S       1.1.1.1 [1/0] via 21.21.21.1, FastEthernet0/1
                [1/0] via 12.12.12.1, FastEthernet0/0
     2.0.0.0/32 is subnetted, 1 subnets
C       2.2.2.2 is directly connected, Loopback0
     100.0.0.0/32 is subnetted, 1 subnets
B       100.100.100.100 [20/0] via 1.1.1.1, 00:03:07
     21.0.0.0/30 is subnetted, 1 subnets
C       21.21.21.0 is directly connected, FastEthernet0/1
     12.0.0.0/30 is subnetted, 1 subnets
C       12.12.12.0 is directly connected, FastEthernet0/0

R2#traceroute 100.100.100.100

  1 12.12.12.1 52 msec
    21.21.21.1 16 msec *

You can see that we learn the 100.100.100.0/32 network from 1.1.1.1, then do a recursive route lookup to find 1.1.1.1 is routed via 21.21.21.1 & 12.12.12.1, which causes it to be load shared.

Leave a comment

Your comment