BGP Design Options
BGP Design Options
Multihomed Environments
Contents
Introduction
Prerequisites
Requirements
Components Used
Load Sharing with the Loopback Address as a BGP Neighbor
Network Diagram
Configurations
Verify
Troubleshoot
Load Sharing When Dual-Homed to One Internet Service Provider (ISP) Through a Single Local
Router
Network Diagram
Configurations
Verify
Troubleshoot
Load Sharing When Dual-Homed to One ISP Through Multiple Local Routers
Network Diagram
Configurations
Verify
Verification When Both Links Between AS 11 and AS 10 Are Up
Verification When the R101-R103 Link Fails
Troubleshoot
Load Sharing When Multihomed to Two ISPs Through a Single Local Router
Network Diagram
Configurations
Verify
Troubleshoot
Load Sharing When Multihomed to Two ISPs Through Multiple Local Routers
Network Diagram
Configurations
Verify
Troubleshoot
Related Information
Introduction
This document describes load sharing, which allows a router to distribute the outgoing and
incoming traffic among multiple paths. The paths are derived either statically or with dynamic
protocols, such as:
● Routing Information Protocol (RIP)
● Enhanced Interior Gateway Routing Protocol (EIGRP)
● Open Shortest Path First (OSPF) Protocol
● Interior Gateway Routing Protocol (IGRP)
By default, Border Gateway Protocol (BGP) selects only a single best path and does not perform
load balancing. This document shows how to perform load sharing in different scenarios with the
use of BGP. For additional information about load balancing, refer to How Does Load Balancing
Work?.
Prerequisites
Requirements
Ensure that you meet these requirements before you attempt this configuration:
Components Used
The information in this document was created from the devices in a specific lab environment. All of
the devices used in this document started with a cleared (default) configuration. If your network is
live, make sure that you understand the potential impact of any command.
Network Diagram
Configurations
This section uses these configurations:
● RouterA
● RouterB
RouterA
interface loopback 0
ip address 1.1.1.1 255.255.255.0
interface serial 0
ip address 160.20.20.1 255.255.255.0
no ip route-cache
interface serial 1
ip address 150.10.10.1 255.255.255.0
no ip route-cache
router bgp 11
neighbor 2.2.2.2 remote-as 10
neighbor 2.2.2.2 update-source loopback 0
!--- Use the IP address of the loopback interface for TCP connections.>
!--- You must configure ebgp-multihop whenever the external BGP (eBGP)
!--- connections are not on the same network address.
router eigrp 12
network 1.0.0.0
network 150.10.0.0
network 160.20.0.0
no auto-summary
RouterB
interface loopback 0
ip address 2.2.2.2 255.255.255.0
interface serial 0
ip address 160.20.20.2 255.255.255.0
no ip route-cache
interface serial 1
ip address 150.10.10.2 255.255.255.0
no ip route-cache
router bgp 10
neighbor 1.1.1.1 remote-as 11
neighbor 1.1.1.1 update-source loopback 0
!--- Use the IP address of the loopback interface for TCP connections.
no auto-summary
Note: You can use static routes in the place of a routing protocol in order to introduce two
equal-cost paths to reach the destination. In this case, the routing protocol is EIGRP.
Verify
The Cisco CLI Analyzer (registered customers only) supports certain show commands. Use the
Cisco CLI Analyzer to view an analysis of show command output.
The output of the show ip route command shows that both of the paths to the 2.2.2.0 network are
learned via EIGRP. The output of the traceroute command indicates that the load is distributed
between two serial links. In this scenario, load sharing occurs on a per-packet basis. You can
issue the ip route-cache command on the serial interfaces to do load sharing on a per-destination
basis. You can also configure per-packet and per-destination load balancing with Cisco Express
Forwarding. For more information on how to configure Cisco Express Forwarding, refer to
Configuring Cisco Express Forwarding.
1 160.20.20.2 16 msec
150.10.10.2 8 msec *
Troubleshoot
This sample configuration uses the maximum-paths command. By default, BGP chooses one
best path among the possible equal-cost paths that are learned from one AS. However, you can
change the maximum number of parallel equal-cost paths that are allowed. In order to make this
change, include the maximum-paths paths command under the BGP configuration. Use a
number between 1 and 6 for the paths argument.
Network Diagram
Configurations
● RouterA
● RouterB
● RouterC
RouterA
1 160.20.20.2 16 msec
150.10.10.2 8 msec *
RouterB
1 160.20.20.2 16 msec
150.10.10.2 8 msec *
RouterC
1 160.20.20.2 16 msec
150.10.10.2 8 msec *
Verify
The Cisco CLI Analyzer (registered customers only) supports certain show commands. Use the
Cisco CLI Analyzer to view an analysis of show command output.
The output of the show ip route command shows that both of the paths to the 2.2.2.0 network are
learned via BGP. The output of the traceroute command indicates that the load is distributed
between two serial links. In this scenario, load sharing occurs on a per-destination basis. The
show ip bgp command gives the valid entries for the 2.0.0.0 network.
1 160.20.20.2 16 msec
150.10.10.2 8 msec *
Troubleshoot
For simplicity, assume that the BGP routing policy for AS 11 is:
● AS 11 accepts the local routes from AS 10, along with a default for the rest of the Internet
routes.
● The outbound traffic policy is:All traffic that is destined to the Internet from R101 goes out
through the R101-R103 link.If the R101-R103 link fails, then all traffic to the Internet from
R101 goes through R102 to AS 10.Similarly, all traffic that is destined to the Internet from
R102 goes through the R102-R104 link.If the R102-R104 link fails, then all traffic to the
Internet from R102 goes through R101 to AS 10.
● The inbound traffic policy is:Traffic that is destined for network 192.168.11.0/24 from the
Internet should come from the R103-R101 link.Traffic that is destined for network
192.168.12.0/24 from the Internet should come from the R104-R102 link.If one link to AS 10
fails, then the other link should route the traffic that is destined for all networks back to AS 11
from the Internet.
In order to achieve this, 192.168.11.0 is announced from R101 to R103 with a shorter AS_PATH
than is announced from R102 to R104. AS 10 finds the best path through the R103-R101 link.
Similarly, 192.168.12.0 is announced with a shorter path through the R102-R104 link. AS 10
prefers the R104-R102 link for traffic that is bound to 192.168.12.0 in AS 11.
For outbound traffic, BGP determines the best path on the basis of routes that are learned through
eBGP. These routes are preferable to routes learned through iBGP. So R101 learns 10.10.34.0
from R103 through eBGP and from R102 through iBGP. The external path is selected over the
internal path. So, if you look at the BGP table in the R101 configuration, the route toward
10.10.34.0 would be through the R101-R103 link, with next hop 10.10.13.3. On R102, the route
toward 10.10.34.0 would be through the R102-R104 link, with next hop 10.10.24.4. This achieves
load sharing for traffic that is destined to 10.10.34.0. Similar reasoning applies to the default routes
on R101 and R102. For more information on BGP path selection criteria, refer to BGP Best Path
Selection Algorithm.
Network Diagram
● R101
● R102
● R103
● R104
R101
1 160.20.20.2 16 msec
150.10.10.2 8 msec *
R102
1 160.20.20.2 16 msec
150.10.10.2 8 msec *
R103
1 160.20.20.2 16 msec
150.10.10.2 8 msec *
R104
1 160.20.20.2 16 msec
150.10.10.2 8 msec *
Verify
This section provides information you can use to confirm your configuration is working properly.
Certain show commands are supported by the Cisco CLI Analyzer (registered customers only) ,
which allows you to view an analysis of show command output.
Note: The greater-than sign (>) in the show ip bgp command output represents the best
path to use for that network among the possible paths. Refer to BGP Best Path Selection
Algorithm for more information.
The BGP table in R101 shows that the best path for all outgoing traffic to the Internet is through
the R101-R103 link. The show ip route command output confirms the routes in the routing table.
The networks 192.168.11.0 and 192.168.12.0 belong to AS 11. According to the policy, AS 11
should prefer the R103-R101 link for traffic that is destined to network 192.168.11.0 and the R104-
R102 link for traffic that is destined to network 192.168.12.0.
!--- Output suppressed. Gateway of last resort is not set B 192.168.12.0/24 [200/0] via
10.10.34.4, 00:04:46
!--- The next hop is R104. B 192.168.11.0/24 [20/0] via 10.10.13.1, 00:04:46
!--- The next hop is R101. 10.0.0.0/24 is subnetted, 2 subnets C 10.10.13.0 is directly
connected, Serial8/0 C 10.10.34.0 is directly connected, Ethernet0/0
The best path for network 192.168.11.0 on R103 is through the R103-R101 link, and the best path
for network 192.168.12.0 is through R104 to AS 11. In this case, the shortest path length
determines the best path.
!--- Output suppressed. Gateway of last resort is not set B 192.168.12.0/24 [20/0] via
10.10.24.2, 00:49:06
!--- The next hop is R102. B 192.168.11.0/24 [200/0] via 10.10.34.3, 00:07:36
!--- The next hop is R103. 10.0.0.0/24 is subnetted, 2 subnets C 10.10.24.0 is directly
connected, Serial8/0 C 10.10.34.0 is directly connected, Ethernet0/0
When the R101-R103 link fails, all traffic should reroute through R102. This diagram illustrates this
change:
Shut down the R103-R101 link on R103 in order to simulate this situation.
Troubleshoot
Refer to Sample Configuration for BGP with Two Different Service Providers (Multihoming) for
additional information.
Network Diagram
● RouterA
● RouterB
● RouterC
RouterA
RouterB
RouterC
Verify
The Cisco CLI Analyzer (registered customers only) supports certain show commands. Use the
Cisco CLI Analyzer to view an analysis of show command output.
The output from the show ip route command and the output from the traceroute command show
that any network lower than 128.0.0.0 exits RouterA through 160.20.20.2. This route is the next
hop out of the serial 0 interface. The rest of the networks exit through 150.10.10.2, which is the
next hop out of the serial 1 interface.
BGP table version is 3, local router ID is 160.20.20.1 Status codes: s suppressed, d damped, h
history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete Network
Next Hop Metric LocPrf Weight Path Network Next Hop Metric LocPrf Weight Path * 2.0.0.0
150.10.10.2 0 0 12 i *> 160.20.20.2 0 100 10 i * 170.16.0.0 160.20.20.2 0 0 10 i *> 150.10.10.2
0 100 12 i RouterA# traceroute 2.2.2.2
Type escape sequence to abort.
Tracing the route to 2.2.2.2
Troubleshoot
This section discusses the multihoming configuration that has the most frequent use. The
configuration shows how to achieve load sharing. See the Network Diagram, in which the
multihome of AS 100 achieves reliability and load sharing.
Note: The IP addresses in this example follow RFC 1918 standards for Private Address
Space and are not routable on the Internet.
For simplicity, assume that the BGP routing policy for AS 100 is:
● AS 100 accepts the local routes from both providers, along with a default for the rest of the
Internet routes.
● The outbound traffic policy is:Traffic that is destined to AS 300 goes through the R1-ISP(A)
link.Traffic that is destined to AS 400 goes through the R2-ISP(B) link.All other traffic should
prefer default route 0.0.0.0 through the R1-ISP(A) link.If the R1-ISP(A) link fails, all traffic
should go through the R2-ISP(B) link.
● The inbound traffic policy is:Traffic that is destined for network 10.10.10.0/24 from the Internet
should come from the ISP(A)-R1 link.Traffic that is destined for network 10.10.20.0/24 from
the Internet should come from the ISP(B)-R2 link.If one ISP fails, the other ISP should route
traffic back to AS 100 from the Internet for all the networks.
Network Diagram
● R2
● R1
R2
BGP table version is 3, local router ID is 160.20.20.1 Status codes: s suppressed, d damped, h
history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete Network
Next Hop Metric LocPrf Weight Path Network Next Hop Metric LocPrf Weight Path * 2.0.0.0
150.10.10.2 0 0 12 i *> 160.20.20.2 0 100 10 i * 170.16.0.0 160.20.20.2 0 0 10 i *> 150.10.10.2
0 100 12 i RouterA# traceroute 2.2.2.2
R1
BGP table version is 3, local router ID is 160.20.20.1 Status codes: s suppressed, d damped, h
history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete Network
Next Hop Metric LocPrf Weight Path Network Next Hop Metric LocPrf Weight Path * 2.0.0.0
150.10.10.2 0 0 12 i *> 160.20.20.2 0 100 10 i * 170.16.0.0 160.20.20.2 0 0 10 i *> 150.10.10.2
0 100 12 i RouterA# traceroute 2.2.2.2
Verify
The Cisco CLI Analyzer (registered customers only) supports certain show commands. Use the
Cisco CLI Analyzer to view an analysis of show command output.
Issue the show ip bgp command in order to verify that the outbound/inbound policy works.
Note: The greater-than sign (>) in the show ip bgp output represents the best path to use
for that network among the possible paths. Refer to BGP Best Path Selection Algorithm for
more information.
!--- This line shows that the default route 0.0.0.0/0 is preferred
!--- through AS 300, ISP(A).
!--- This line shows that the default route 0.0.0.0/0 is preferred
!--- through AS 300, through the R2-ISP(B) link.
!--- This line shows that network 10.10.10.0/24 is routed through AS 300
!--- with the ISP(A)-R1 link.
!--- This line shows that network 10.10.20.0/24 is routed through AS 400
!--- with the ISP(B)-R2 link.
!--- The best default path is now through the R2-ISP(B) link.
Troubleshoot
Related Information
● BGP Multi-homing: Design and Troubleshooting - Video from live Webcast
● BGP Multi-homing: Design and Troubleshooting - Questions and Answers from live
Webcast
● How Does Load Balancing Work?
● Sample Configuration for BGP with Two Different Service Providers (Multihoming)
● How BGP Routers Use the Multi-Exit Discriminator for Best Path Selection
● IP Routing Technology Support Page
● Technical Support & Documentation - Cisco Systems