ccie blog

BGP Load Sharing a Dual-Homed Connection To One ISP

In this setup we have a dual-homed connection to a single ISP. We are using one router in our customer AS, but connecting to two different routers at our ISP. In this lab we are going to share traffic over both links to our ISP when sending traffic outbound. Note: this does not affect inbound traffic towards our AS. This is because load-sharing is unidirectional. More information about this can be found on my very short thread about load-sharing vs load-balancing.

Also notice that I’ve assigned a private BGP AS number for the customer. The private BGP AS numbers range 64512 – 65535. This AS number will be stripped off by your ISP when they advertise your prefix out to the internet. This makes it look like your prefix belongs to AS2: Which in most cases is correct because your ISP probably will have provided you with your prefix. In real life, you would most likely use a private AS in this setup because you are connecting to only one ISP. When having a dual-homed connection to multiple ISPs, you will more likely use a public AS, and be assigned your own prefix from your Regional Internet Registry (RIR): In Europe this company is RIPE.

I’ve pre-configured each device with IP’s and network statements. Below shows the current BGP configuration on R1.

R1#sh run | s bgp

router bgp 64512
 no synchronization
 bgp router-id 1.1.1.1
 bgp log-neighbor-changes
 neighbor 12.12.12.2 remote-as 2
 neighbor 21.21.21.2 remote-as 2
 no auto-summary

R1#sh ip bgp 32.32.32.0
BGP routing table entry for 32.32.32.0/30, version 2
Paths: (2 available, best #2, table Default-IP-Routing-Table)
Flag: 0x820
  Advertised to update-groups:
     1
  2
    21.21.21.2 from 21.21.21.2 (3.3.3.3)
      Origin IGP, metric 0, localpref 100, valid, external
  2
    12.12.12.2 from 12.12.12.2 (2.2.2.2)
      Origin IGP, metric 0, localpref 100, valid, external, best

As you can see. R1 is currently using one path to reach the 32.32.32.0/30 network. This is via R2, using the 12.12.12.2 next hop (chosen as the best path because the path is older via R2 = more preferred). Let’s make the relatively simple config change required in order to use both R2 and R3 as outbound paths to reach the 32.32.32.0/30 network.

R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#router bgp 64512
R1(config-router)#maximum-paths 2
R1(config-router)#end

R1#sh ip bgp 32.32.32.0
BGP routing table entry for 32.32.32.0/30, version 3
Paths: (2 available, best #2, table Default-IP-Routing-Table)
Multipath: eBGP
Flag: 0x800
  Advertised to update-groups:
     1
  2
    21.21.21.2 from 21.21.21.2 (3.3.3.3)
      Origin IGP, metric 0, localpref 100, valid, external, multipath
  2
    12.12.12.2 from 12.12.12.2 (2.2.2.2)
      Origin IGP, metric 0, localpref 100, valid, external, multipath, best

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

     32.0.0.0/30 is subnetted, 1 subnets
B       32.32.32.0 [20/0] via 21.21.21.2, 00:00:23
                   [20/0] via 12.12.12.2, 00:05:47
     21.0.0.0/30 is subnetted, 1 subnets
C       21.21.21.0 is directly connected, FastEthernet0/0
     12.0.0.0/30 is subnetted, 1 subnets
C       12.12.12.0 is directly connected, FastEthernet0/1

As you can see, the bgp table entry for this network now includes the multipath field, indicating the best path is over multiple links. This verification of this is shown in the output of the routing table.

One last point. You only need the maximum-paths command when you are connecting from one router to two or more BGP speakers. If this network was simply one router in AS 64512 connecting to one router in AS2 (but using 2 cables), we would not require the maximum-paths command. You can view this setup here.

Leave a comment

Your comment