BGP Multipath
Introduction
Throughout this BGP series, I’ve covered numerous attributes that influence which single path BGP selects as best:
- Weight, Local Preference: Control outbound path selection
- AS-Path, MED: Influence path decisions
- Communities: Signal routing policies
But all of these mechanisms follow the same fundamental principle: BGP selects one best path per prefix. Even if you have multiple equal-cost paths to a destination, by default, BGP picks one and discards the rest.
That’s where BGP Multipath comes in.
Multipath allows BGP to install multiple equal-cost paths into the routing table simultaneously, enabling load balancing across multiple links. Instead of leaving backup paths idle, you can utilize all available bandwidth.
This post covers three multipath scenarios:
- eBGP multipath: Load balance across multiple eBGP neighbors
- iBGP multipath: Load balance across multiple iBGP neighbors
- eiBGP multipath: Load balance across BOTH eBGP and iBGP neighbors (mixed)
Understanding BGP’s Single Best Path Behavior
Default BGP Path Selection
By default, BGP follows a strict single-path paradigm:
The Problem with Single Path
Consider this scenario:
Multipath solves this by installing BOTH paths.
What is BGP Multipath?
Multipath allows BGP to install multiple equal-cost paths:
The key is that paths must be equal-cost – they must tie at the point in the best-path algorithm where multipath evaluation occurs.
Lab Topology
Same topology from previous BGP posts:
- AS 100: R10 (connected to R1 and R2 in AS 12)
- AS 12: R1, R2 (iBGP full mesh within AS 12)
- AS 1000: R3, R4 (connected to AS 12 and AS 2000)
- AS 2000: R7, R8, R9 (iBGP mesh, R9 is route reflector)
We’ll use three different scenarios:
- R10: Load balance across R1 and R2 (both eBGP)
- R9: Load balance across R7 and R8 (both iBGP)
- R3: Load balance across R1 (eBGP) and R4 (iBGP) - mixed
Example 1: eBGP Multipath
Requirement
R10 needs to be configured to use both R1 and R2 to reach the rest of the network. Configure R10 such that it load balances between R1 and R2. R1 and R2 are eBGP neighbors.
Translation:
- R10 has two eBGP peers: R1 and R2 (both in AS 12)
- Both paths should be active simultaneously
- Traffic should load balance across both links
Initial State (Before Multipath)
R10’s BGP table:
R10 has two paths for each network:
- Via 192.1.120.2 (R2): Marked with
*(valid, not best) - Via 192.1.110.1 (R1): Marked with
*>(valid and best)
Why is R1 chosen? Looking at the paths:
- Network 1.0.0.0 via R1: MED=0
- Network 1.0.0.0 via R2: MED is blank (missing)
- Network 2.0.0.0 via R1: MED is blank
- Network 2.0.0.0 via R2: MED=0
The tie-breaking goes down the algorithm. Since both paths are eBGP with the same AS-Path, it likely comes down to IGP metric to next-hop or router-ID. R1 wins consistently.
R10’s routing table:
Only ONE path per prefix in the routing table. R2’s link is idle.
Configuration
Enable eBGP multipath on R10:
That’s it! One command enables multipath for eBGP neighbors.
Syntax:
Results After Multipath Configuration
R10’s BGP table:
Key changes:
- Path via R2 now marked with
*m(valid, multipath) - Path via R1 still marked with
*>(valid, best) - Both paths are now active!
The m flag indicates multipath – this path is selected as an additional equal-cost path alongside the best path.
R10’s routing table:
Perfect! Both next-hops are installed for each prefix:
- 1.0.0.0/8: via 192.1.120.2 (R2) AND via 192.1.110.1 (R1)
- 2.0.0.0/8: via 192.1.120.2 (R2) AND via 192.1.110.1 (R1)
Traffic to these networks will now load balance across both R1 and R2 links.
Load Balancing Behavior
How does the router actually distribute traffic?
Per-destination load balancing (default):
This is per-flow load balancing:
- Individual flows are sticky to one path
- Different flows may use different paths
- Prevents packet reordering within a flow
Result: Traffic distributes across both links, roughly 50/50 over time.
Example 2: iBGP Multipath
Requirement
R9 needs to be configured to use both R7 and R8 to reach the rest of the network. Configure R9 such that it load balances between R7 and R8. R7 and R8 are iBGP neighbors.
Translation:
- R9 has two iBGP peers: R7 and R8 (all in AS 2000)
- Both paths should be active simultaneously
- Traffic should load balance across both links
Initial State (Before Multipath)
R9’s BGP table:
R9 has two paths for each network:
- Via 10.8.8.8 (R8): Marked with
*i(valid, internal, not best) - Via 10.7.7.7 (R7): Marked with
*>i(valid, internal, best)
Both paths are iBGP. The tie-breaking goes through the best-path algorithm, and R7 wins (likely due to IGP metric to next-hop or router-ID).
R9’s routing table:
Configuration
Enable iBGP multipath on R9:
Critical difference: For iBGP multipath, use the ibgp keyword.
Syntax:
Results After Multipath Configuration
R9’s BGP table:
Key changes:
- Path via R8 now marked with
*mi(valid, multipath, internal) - Path via R7 still marked with
*>i(valid, best, internal) - Both iBGP paths are now active!
R9’s routing table:
Perfect! Both iBGP next-hops are installed:
- Administrative distance: 200 (iBGP)
- Next-hops: 10.8.8.8 (R8) and 10.7.7.7 (R7)
Traffic now load balances across both R7 and R8 links.
iBGP Multipath Considerations
Split-horizon warning: In iBGP full mesh, R9 may receive the same route from multiple iBGP peers, but iBGP split-horizon rules prevent R9 from advertising routes learned via iBGP to other iBGP peers.
Route reflector compatibility: If R9 is a route reflector (as in our topology), iBGP multipath works normally. If R9 is a route reflector client, ensure the RR is configured to reflect multiple paths.
Example 3: eiBGP Multipath (Mixed eBGP and iBGP)
Requirement
R3 needs to be configured to use both R1 and R4 to reach the rest of the network. Configure R3 such that it load balances between R1 and R4. R1 is an eBGP neighbor and R4 is an iBGP neighbor.
Translation:
- R3 has one eBGP peer: R1 (AS 12)
- R3 has one iBGP peer: R4 (both in AS 1000)
- Load balance across BOTH eBGP and iBGP paths simultaneously
This is the tricky scenario – mixing eBGP and iBGP paths.
Initial State (Before Multipath)
R3’s BGP table:
R3 has two paths for each network:
- Via 192.168.34.4 (R4): iBGP path, marked with
*i - Via 192.1.13.1 (R1): eBGP path, marked with
*>
Why does eBGP win? Step 7 in the best-path algorithm: eBGP is preferred over iBGP. Even though both paths have the same Weight, Local Preference, AS-Path length, etc., the eBGP path wins by default.
R3’s routing table:
Configuration
Enable eiBGP multipath on R3:
Critical keyword: eibgp (not ibgp, not the default)
Syntax:
The Loop Warning
When you configure eibgp, Cisco IOS displays a warning:
Why the warning?
If R4 (iBGP peer) also has multipath configured and learns routes from R3, you can create a loop:
Solution: Ensure your IGP metrics and AS topology prevent loops. Typically, this works safely when:
- eBGP paths are genuinely external (not via iBGP peers)
- Proper route reflector hierarchy exists
- You’re not creating transit scenarios through iBGP
Results After Multipath Configuration
R3’s BGP table:
Key changes:
- iBGP path via R4 now marked with
*mi(valid, multipath, internal) - eBGP path via R1 still marked with
*>(valid, best) - Mixed eBGP and iBGP paths are both active!
R3’s routing table:
Interesting! Both next-hops installed:
- 192.168.34.4 (R4, iBGP) – AD 20 shown (but actually learned via iBGP with AD 200)
- 192.1.13.1 (R1, eBGP) – AD 20 (eBGP)
The display shows AD 20 for both because CEF load balances based on the best path’s AD. Both are treated equally for forwarding purposes.
Traffic now load balances across both eBGP (R1) and iBGP (R4) links.
Requirements for Multipath Selection
For BGP to install multiple paths via multipath, the paths must be equal at the point where multipath evaluation occurs. Specifically:
Equal-Cost Requirements
Paths must tie through these best-path steps:
- ✓ Weight (must be equal)
- ✓ Local Preference (must be equal)
- ✓ Locally originated (both or neither)
- ✓ AS-Path length (must be equal)
- ✓ Origin type (must be equal)
- ✓ MED (must be equal for same-AS paths)
- ← Multipath evaluation happens here
If paths are equal through step 6, they’re candidates for multipath. The evaluation at step 7 (eBGP vs iBGP) depends on the multipath type:
What Breaks Multipath?
Different AS-Path lengths:
Different Local Preferences:
Different MEDs (when comparing same AS):
Mixed eBGP/iBGP without eibgp:
Multipath Configuration Matrix
Here’s a complete reference for all multipath scenarios:
| Scenario | Command | Effect | Use Case |
|---|---|---|---|
| eBGP only | maximum-paths 2 |
Load balance across eBGP peers | Dual ISP, dual peering |
| iBGP only | maximum-paths ibgp 2 |
Load balance across iBGP peers | Internal backbone links |
| Mixed eBGP+iBGP | maximum-paths eibgp 2 |
Load balance across both | Complex topologies (use carefully) |
| eBGP and iBGP separately | maximum-paths 2maximum-paths ibgp 2 |
Independent limits | Different path counts |