Multipath eBGP and iBGP
Install more than one eligible BGP forwarding path without confusing ECMP with advertising multiple paths.
Equal external candidates
R1 receives the same /24 from R2 and R3 in AS65023. Both originate an equal connected test subnet and also have an internal session. The two direct eBGP next hops are reachable with equal local interface cost.
| Link | First endpoint | Second endpoint |
|---|---|---|
| R1–R2 | GigabitEthernet1 192.0.2.1/30 | GigabitEthernet1 192.0.2.2/30 |
| R1–R3 | GigabitEthernet2 192.0.2.5/30 | GigabitEthernet1 192.0.2.6/30 |
| R2–R3 | GigabitEthernet2 192.0.2.9/30 | GigabitEthernet2 192.0.2.10/30 |
Complete baseline configurations
R1
hostname R1
ip cef
interface Loopback0
ip address 10.255.0.1 255.255.255.255
exit
interface GigabitEthernet1
ip address 192.0.2.1 255.255.255.252
no shutdown
exit
interface GigabitEthernet2
ip address 192.0.2.5 255.255.255.252
no shutdown
exit
router bgp 65001
bgp router-id 10.255.0.1
no bgp default ipv4-unicast
neighbor 192.0.2.2 remote-as 65023
neighbor 192.0.2.6 remote-as 65023
address-family ipv4 unicast
no auto-summary
neighbor 192.0.2.2 activate
neighbor 192.0.2.6 activate
exit-address-family
endR2
hostname R2
ip cef
interface Loopback0
ip address 10.255.0.2 255.255.255.255
exit
interface Loopback10
ip address 198.51.100.1 255.255.255.0
exit
interface GigabitEthernet1
ip address 192.0.2.2 255.255.255.252
no shutdown
exit
interface GigabitEthernet2
ip address 192.0.2.9 255.255.255.252
no shutdown
exit
router bgp 65023
bgp router-id 10.255.0.2
no bgp default ipv4-unicast
neighbor 192.0.2.1 remote-as 65001
neighbor 192.0.2.10 remote-as 65023
address-family ipv4 unicast
no auto-summary
neighbor 192.0.2.1 activate
neighbor 192.0.2.10 activate
network 198.51.100.0 mask 255.255.255.0
exit-address-family
endR3
hostname R3
ip cef
interface Loopback0
ip address 10.255.0.3 255.255.255.255
exit
interface Loopback10
ip address 198.51.100.1 255.255.255.0
exit
interface GigabitEthernet1
ip address 192.0.2.6 255.255.255.252
no shutdown
exit
interface GigabitEthernet2
ip address 192.0.2.10 255.255.255.252
no shutdown
exit
router bgp 65023
bgp router-id 10.255.0.3
no bgp default ipv4-unicast
neighbor 192.0.2.5 remote-as 65001
neighbor 192.0.2.9 remote-as 65023
address-family ipv4 unicast
no auto-summary
neighbor 192.0.2.5 activate
neighbor 192.0.2.9 activate
network 198.51.100.0 mask 255.255.255.0
exit-address-family
endR1# show ip bgp
Network Next Hop Metric LocPrf Weight Path
*> 198.51.100.0/24 192.0.2.2 0 0 65023 i
* 198.51.100.0/24 192.0.2.6 0 0 65023 iThe illustrated baseline marks only R2’s path best. More than one received route does not automatically install multiple next hops.
Enable external multipath
router bgp 65001
address-family ipv4 unicast
maximum-paths 2
exit-address-familyR1# show ip route 198.51.100.0
Routing entry for 198.51.100.0/24
Known via "bgp 65001", distance 20, metric 0
* 192.0.2.2, via GigabitEthernet1
192.0.2.6, via GigabitEthernet2The paths must satisfy the platform’s multipath equality rules, including relevant weight, local preference, AS-path, ORIGIN, MED and reachability comparisons. One BGP path remains designated best even when more than one forwarding path is installed.
Compare paths from different neighboring ASes
Start this independent baseline with R2 in AS65002 and R3 in AS65003. Different-neighbor-AS paths may fail the default multipath AS-path equality test. On a supporting image, multipath-relax allows certain equal-length but different AS sequences; it does not ignore earlier attributes or make an unreachable path usable.
| Link | First endpoint | Second endpoint |
|---|---|---|
| R1–R2 | GigabitEthernet1 192.0.2.1/30 | GigabitEthernet1 192.0.2.2/30 |
| R1–R3 | GigabitEthernet2 192.0.2.5/30 | GigabitEthernet1 192.0.2.6/30 |
Complete baseline configurations
R1
hostname R1
ip cef
interface Loopback0
ip address 10.255.0.1 255.255.255.255
exit
interface GigabitEthernet1
ip address 192.0.2.1 255.255.255.252
no shutdown
exit
interface GigabitEthernet2
ip address 192.0.2.5 255.255.255.252
no shutdown
exit
router bgp 65001
bgp router-id 10.255.0.1
no bgp default ipv4-unicast
neighbor 192.0.2.2 remote-as 65002
neighbor 192.0.2.6 remote-as 65003
address-family ipv4 unicast
no auto-summary
neighbor 192.0.2.2 activate
neighbor 192.0.2.6 activate
exit-address-family
endR2
hostname R2
ip cef
interface Loopback0
ip address 10.255.0.2 255.255.255.255
exit
interface Loopback10
ip address 198.51.100.1 255.255.255.0
exit
interface GigabitEthernet1
ip address 192.0.2.2 255.255.255.252
no shutdown
exit
router bgp 65002
bgp router-id 10.255.0.2
no bgp default ipv4-unicast
neighbor 192.0.2.1 remote-as 65001
address-family ipv4 unicast
no auto-summary
neighbor 192.0.2.1 activate
network 198.51.100.0 mask 255.255.255.0
exit-address-family
endR3
hostname R3
ip cef
interface Loopback0
ip address 10.255.0.3 255.255.255.255
exit
interface Loopback10
ip address 198.51.100.1 255.255.255.0
exit
interface GigabitEthernet1
ip address 192.0.2.6 255.255.255.252
no shutdown
exit
router bgp 65003
bgp router-id 10.255.0.3
no bgp default ipv4-unicast
neighbor 192.0.2.5 remote-as 65001
address-family ipv4 unicast
no auto-summary
neighbor 192.0.2.5 activate
network 198.51.100.0 mask 255.255.255.0
exit-address-family
endrouter bgp 65001
address-family ipv4 unicast
maximum-paths 2
exit-address-familyrouter bgp 65001
bgp bestpath as-path multipath-relaxR1# show ip route 198.51.100.0
Routing entry for 198.51.100.0/24
Known via "bgp 65001", distance 20, metric 0
* 192.0.2.2, via GigabitEthernet1
192.0.2.6, via GigabitEthernet2The two one-token paths have matching earlier attributes. Remove the relaxation after this separate test; the saved first baseline uses the same neighboring AS.
Enable iBGP multipath in an internal scenario
Start this third independent baseline: all routers use AS65123 and form a full mesh over their OSPF-reachable loopbacks. R2 and R3 originate the same test /24 from loopbacks excluded from OSPF. Thus the IGP supplies next-hop reachability without competing to install the destination prefix.
| Link | First endpoint | Second endpoint |
|---|---|---|
| R1–R2 | GigabitEthernet1 192.0.2.1/30 | GigabitEthernet1 192.0.2.2/30 |
| R1–R3 | GigabitEthernet2 192.0.2.5/30 | GigabitEthernet1 192.0.2.6/30 |
| R2–R3 | GigabitEthernet2 192.0.2.9/30 | GigabitEthernet2 192.0.2.10/30 |
Complete baseline configurations
R1
hostname R1
ip cef
interface Loopback0
ip address 10.255.0.1 255.255.255.255
exit
interface GigabitEthernet1
ip address 192.0.2.1 255.255.255.252
no shutdown
exit
interface GigabitEthernet2
ip address 192.0.2.5 255.255.255.252
no shutdown
exit
router ospf 1
router-id 10.255.0.1
network 10.255.0.1 0.0.0.0 area 0
passive-interface Loopback0
network 192.0.2.1 0.0.0.0 area 0
network 192.0.2.5 0.0.0.0 area 0
exit
router bgp 65123
bgp router-id 10.255.0.1
no bgp default ipv4-unicast
neighbor 10.255.0.2 remote-as 65123
neighbor 10.255.0.2 update-source Loopback0
neighbor 10.255.0.3 remote-as 65123
neighbor 10.255.0.3 update-source Loopback0
address-family ipv4 unicast
no auto-summary
neighbor 10.255.0.2 activate
neighbor 10.255.0.3 activate
exit-address-family
endR2
hostname R2
ip cef
interface Loopback0
ip address 10.255.0.2 255.255.255.255
exit
interface Loopback10
ip address 198.51.100.1 255.255.255.0
exit
interface GigabitEthernet1
ip address 192.0.2.2 255.255.255.252
no shutdown
exit
interface GigabitEthernet2
ip address 192.0.2.9 255.255.255.252
no shutdown
exit
router ospf 1
router-id 10.255.0.2
network 10.255.0.2 0.0.0.0 area 0
passive-interface Loopback0
network 192.0.2.2 0.0.0.0 area 0
network 192.0.2.9 0.0.0.0 area 0
exit
router bgp 65123
bgp router-id 10.255.0.2
no bgp default ipv4-unicast
neighbor 10.255.0.1 remote-as 65123
neighbor 10.255.0.1 update-source Loopback0
neighbor 10.255.0.3 remote-as 65123
neighbor 10.255.0.3 update-source Loopback0
address-family ipv4 unicast
no auto-summary
neighbor 10.255.0.1 activate
neighbor 10.255.0.3 activate
network 198.51.100.0 mask 255.255.255.0
exit-address-family
endR3
hostname R3
ip cef
interface Loopback0
ip address 10.255.0.3 255.255.255.255
exit
interface Loopback10
ip address 198.51.100.1 255.255.255.0
exit
interface GigabitEthernet1
ip address 192.0.2.6 255.255.255.252
no shutdown
exit
interface GigabitEthernet2
ip address 192.0.2.10 255.255.255.252
no shutdown
exit
router ospf 1
router-id 10.255.0.3
network 10.255.0.3 0.0.0.0 area 0
passive-interface Loopback0
network 192.0.2.6 0.0.0.0 area 0
network 192.0.2.10 0.0.0.0 area 0
exit
router bgp 65123
bgp router-id 10.255.0.3
no bgp default ipv4-unicast
neighbor 10.255.0.1 remote-as 65123
neighbor 10.255.0.1 update-source Loopback0
neighbor 10.255.0.2 remote-as 65123
neighbor 10.255.0.2 update-source Loopback0
address-family ipv4 unicast
no auto-summary
neighbor 10.255.0.1 activate
neighbor 10.255.0.2 activate
network 198.51.100.0 mask 255.255.255.0
exit-address-family
endrouter bgp 65123
address-family ipv4 unicast
maximum-paths ibgp 2
exit-address-familyR1# show ip route 198.51.100.0
Routing entry for 198.51.100.0/24
Known via "bgp 65123", distance 200, metric 0
* 10.255.0.2, recursively via 192.0.2.2
10.255.0.3, recursively via 192.0.2.6| Mechanism | Purpose |
|---|---|
| maximum-paths | Local ECMP installation for eligible external candidates. |
| maximum-paths ibgp | Local ECMP installation for eligible internal candidates. |
| Add-Path | Advertise multiple distinguishable paths over one session. |
| IGP ECMP to a loopback | Several underlay ways to reach one BGP next hop. |
A reflector sending only one selected path cannot create a second candidate at the client. This full-mesh lab supplies both candidates directly.
Understand traffic distribution
Forwarding normally uses a flow hash, with behavior depending on the platform. A single TCP connection generally uses one member rather than alternating every packet. Different flows may distribute differently; ECMP does not promise an exact 50/50 byte split. A failed member can be removed while remaining paths carry traffic.
Restore single-path installation
router bgp 65001
address-family ipv4 unicast
no maximum-paths 2
exit-address-familyrouter bgp 65123
address-family ipv4 unicast
no maximum-paths ibgp 2
exit-address-familyrouter bgp 65001
no bgp bestpath as-path multipath-relaxR1# show ip route 198.51.100.0
Routing entry for 198.51.100.0/24
Known via "bgp 65001", distance 20, metric 0
* 192.0.2.2, via GigabitEthernet1The illustrated later tie-break selects R2. Exact best-path choice when earlier attributes tie depends on the full set of platform tie-breakers, not neighbor configuration order.
Key Takeaways
- Multipath installs eligible additional forwarding next hops.
- Candidate attributes and reachability must satisfy equality rules.
- Internal and external maximum-paths settings are distinct.
- Add-Path advertises alternatives; ECMP installs alternatives.
- Flow hashing does not promise equal packet-by-packet distribution.
Protocol and command references
Multipath configuration · Additional paths · Router-symbol attribution.