PacketLab
BGP · Advanced BGP Features

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.

Lab topologyPhysical links
.1 / .2.5 / .6.9 / .10R1AS 65001R2AS 65023R3AS 65023
Solid lines are physical links. Endpoint labels are the last octets of 192.0.2.x/30, first router then second router in the address table. Loopback0 is 10.255.0.N/32 on RN. Logical BGP peers are listed in the configurations.
LinkFirst endpointSecond endpoint
R1–R2GigabitEthernet1 192.0.2.1/30GigabitEthernet1 192.0.2.2/30
R1–R3GigabitEthernet2 192.0.2.5/30GigabitEthernet1 192.0.2.6/30
R2–R3GigabitEthernet2 192.0.2.9/30GigabitEthernet2 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
end

R2

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
end

R3

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
end

Open plain-text configurations

Outputs are illustrative, not recorded router results. Each lab starts from its own baseline. Configuration and feature support vary by image and release; platform-specific examples identify their prerequisites.
R1# 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 i

The 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-family
R1# 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 GigabitEthernet2

The 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.

Lab topologyPhysical links
.1 / .2.5 / .6R1AS 65001R2AS 65002R3AS 65003
Solid lines are physical links. Endpoint labels are the last octets of 192.0.2.x/30, first router then second router in the address table. Loopback0 is 10.255.0.N/32 on RN. Logical BGP peers are listed in the configurations.
LinkFirst endpointSecond endpoint
R1–R2GigabitEthernet1 192.0.2.1/30GigabitEthernet1 192.0.2.2/30
R1–R3GigabitEthernet2 192.0.2.5/30GigabitEthernet1 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
end

R2

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
end

R3

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
end

Open plain-text configurations

Outputs are illustrative, not recorded router results. Each lab starts from its own baseline. Configuration and feature support vary by image and release; platform-specific examples identify their prerequisites.
router bgp 65001
 address-family ipv4 unicast
  maximum-paths 2
 exit-address-family
router bgp 65001
 bgp bestpath as-path multipath-relax
R1# 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 GigabitEthernet2

The 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.

Lab topologyPhysical links
.1 / .2.5 / .6.9 / .10R1AS 65123R2AS 65123R3AS 65123
Solid lines are physical links. Endpoint labels are the last octets of 192.0.2.x/30, first router then second router in the address table. Loopback0 is 10.255.0.N/32 on RN. Logical BGP peers are listed in the configurations.
LinkFirst endpointSecond endpoint
R1–R2GigabitEthernet1 192.0.2.1/30GigabitEthernet1 192.0.2.2/30
R1–R3GigabitEthernet2 192.0.2.5/30GigabitEthernet1 192.0.2.6/30
R2–R3GigabitEthernet2 192.0.2.9/30GigabitEthernet2 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
end

R2

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
end

R3

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
end

Open plain-text configurations

Outputs are illustrative, not recorded router results. Each lab starts from its own baseline. Configuration and feature support vary by image and release; platform-specific examples identify their prerequisites.
router bgp 65123
 address-family ipv4 unicast
  maximum-paths ibgp 2
 exit-address-family
R1# 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
MechanismPurpose
maximum-pathsLocal ECMP installation for eligible external candidates.
maximum-paths ibgpLocal ECMP installation for eligible internal candidates.
Add-PathAdvertise multiple distinguishable paths over one session.
IGP ECMP to a loopbackSeveral 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-family
router bgp 65123
 address-family ipv4 unicast
  no maximum-paths ibgp 2
 exit-address-family
router bgp 65001
 no bgp bestpath as-path multipath-relax
R1# 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

The 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.

Multipath eBGP and iBGP Quiz

Six questions · four options each · select one answer per question. Submit all answers to see your score and explanations.

1. What enables two external forwarding paths in this lab?
2. Does receiving two BGP rows automatically install ECMP?
3. Which mechanism sends multiple paths over one session?
4. Can one TCP flow normally be assumed to split packets equally over both links?
5. Does multipath-relax override unequal local preference?
6. What does maximum-paths ibgp control?
Protocol and command references

Multipath configuration · Additional paths · Router-symbol attribution.