Cisco maximum-paths Explained: ECMP, CEF Hashing, and Real Traffic Distribution

The Cisco maximum-paths command sets how many eligible equal-cost routes a routing protocol may install for the same destination. It is a control-plane permission: it lets multiple next hops reach the routing table and forwarding table. It does not decide how traffic is spread across those next hops. That decision belongs to Cisco Express Forwarding (CEF) and the platform’s forwarding hardware.

The difference matters in practice. Engineers configure maximum-paths 2, see one link at 90 percent and the other nearly idle, and assume ECMP is broken. Usually it is working exactly as designed. This article explains why and shows how to verify it.

1. The short answer

maximum-paths is a ceiling, not a target. If only one path qualifies, only one path is installed. If six paths qualify and the value is 4, only four are installed for that prefix.

Setting What it allows Typical use
maximum-paths 1 One installed next hop. Other equal candidates stay in the protocol database as alternatives. Deliberate single-path forwarding
maximum-paths 2 Up to two eligible next hops installed for CEF load sharing Dual circuits, dual eBGP peers, two routed uplinks
maximum-paths 4 Up to four eligible next hops installed for CEF load sharing Four-way leaf-spine, multiple WAN paths

Neither value splits a single connection across links, makes unequal routes equal, or guarantees even utilization.

2. The control plane and data plane have different jobs

Component Primary responsibility What it does not decide
Routing protocol Learns routes, compares candidates, and identifies eligible paths Which packet uses which path
maximum-paths Limits how many eligible paths may be installed Hash fields or forwarding algorithm
RIB Holds the selected routes and next hops High-speed packet switching
CEF and hardware forwarding Programs forwarding state and maps traffic to next hops Whether a BGP path qualifies as a multipath

3. Default values by protocol

BGP is the protocol that most often needs maximum-paths configured, because it installs a single best path by default. The IGPs already install multiple equal-cost paths out of the box on Cisco IOS and IOS-XE.

Protocol Default on IOS / IOS-XE Notes
BGP 1 eBGP and iBGP multipath are configured separately
OSPF 4 Equal total cost required
EIGRP 4 Unequal-cost possible with variance
IS-IS 4 Equal total metric required

The configurable maximum, and defaults on NX-OS and other operating systems, vary by platform and release. Check the command reference for your platform.

Raising the value installs more next hops only when all of the following are true:

  • The routing protocol has multiple qualifying paths
  • The platform supports the requested ECMP width
  • The routes resolve to usable, distinct next hops
  • No policy or attribute makes the paths unequal

Installing paths and using them evenly are separate questions. Multiple eligible paths can be installed even when there is no traffic at all. Even when multiple next hops are installed, effective traffic distribution depends on sufficient diversity in the fields used by the forwarding hash. That depends on what the platform hashes, which is covered next.

4. How CEF distributes traffic

Cisco’s own term for default CEF behavior is per-destination load sharing. The forwarding plane computes a deterministic hash from selected header fields and maps the result to one member of the ECMP set. Every packet that produces the same hash follows the same path while the ECMP set stays unchanged.

What your platform actually hashes

Which fields go into the hash determines what counts as a separate flow. This is the most important platform detail in any ECMP design, and it differs across Cisco product families.

Platform Default hash inputs Add Layer 4 ports Check with
IOS / IOS-XE routers (classic CEF) Universal algorithm: source IP, destination IP, and a per-router universal ID ip cef load-sharing algorithm include-ports source destination show ip cef exact-route
Catalyst 9000 Varies by model and release; do not assume it matches router CEF Hardware hash fields and include-ports support vary; check the platform configuration guide show ip cef exact-route plus platform-specific hardware commands
Nexus 9000 (NX-OS) Commonly address source-destination port source-destination (L3 and L4) ip load-sharing address source-destination port source-destination show ip load-sharing, show routing hash

On platforms using an IP-only ECMP hash, multiple TCP connections between the same source and destination IP addresses map to the same next hop. Platforms that include Layer 4 ports add entropy and may distribute those connections across different paths. Always verify the actual hashing behavior for the hardware and software release.

On a router using the classic IP-only universal algorithm, the two connections below hash identically:

Flow 1: 10.10.10.25:51842 -> 172.16.50.20:443  TCP
Flow 2: 10.10.10.25:51907 -> 172.16.50.20:443  TCP

IP-only hash (classic router CEF):  same result, same path
L3+L4 hash (include-ports, NX-OS): results may differ, paths may differ

“Per flow” is accurate shorthand only when the flow definition matches the hash inputs. On an IP-only hash, every conversation between the same two hosts is effectively one flow.

Universal hashing and polarization

The universal algorithm adds a router-specific value, the universal ID, to the hash. Without it, every router using identical inputs and an identical function would make the same relative choice: a flow assigned to link 1 at one layer would land on link 1 again at the next layer. That concentration is called CEF polarization. The per-router seed makes different devices make different bucket assignments for the same flow.

Per-flow versus per-packet

Some Cisco software platforms support per-packet load sharing, configured per interface with ip load-sharing per-packet. It sends successive packets over different paths in round-robin order. Most hardware switching platforms do not support it.

Per-packet spreads bytes more evenly, but it can reorder packets across paths with different queue depth or latency. TCP receivers respond to reordering with duplicate acknowledgments, and the sender may treat it as loss and cut its rate even though nothing was dropped. For that reason, per-destination hashing remains the normal recommendation.

5. Why traffic is rarely 50/50 or 25/25/25/25

ECMP hashes flows, not bytes, and flows are not equal in size or duration. With many independent flows, a sustained split near 40/60 on two paths is a reasonable healthy result. This is an observation, not a Cisco threshold. A 0/100 split can also be correct when the traffic is one large transfer.

Traffic pattern Likely result
Thousands of flows between many host pairs Distribution approaches the expected ratio over time
A few large elephant flows One path may carry substantially more than another
One large TCP transfer Uses one path
Many connections between the same two hosts One path on an IP-only hash; spread on an L3+L4 hash
Traffic dominated by one host pair (backup, replication, tunnel endpoints) Concentrates on one path unless the hash sees additional entropy

Two more sources of built-in skew are worth knowing about. On some platforms the number of hash buckets does not divide evenly by the number of paths, so a three-way ECMP set can carry a small imbalance even with ideal traffic. And two equal 10 Gbps paths provide 20 Gbps of aggregate capacity, but a single ordinary TCP flow still tops out at 10 Gbps.

6. BGP maximum-paths

BGP installs one best path by default. maximum-paths permits additional eligible paths to be installed for forwarding.

router bgp 65000
 neighbor 192.0.2.1 remote-as 65100
 neighbor 192.0.2.5 remote-as 65100
 !
 address-family ipv4
  neighbor 192.0.2.1 activate
  neighbor 192.0.2.5 activate
  maximum-paths 2
  maximum-paths ibgp 2

In IOS-XE, plain maximum-paths applies to eBGP paths and maximum-paths ibgp applies to iBGP paths. Mixed eBGP/iBGP multipath (maximum-paths eibgp) is available in specific contexts such as MPLS VPN VRFs. Command forms differ on NX-OS and IOS-XR.

BGP still chooses one best path

Multipath does not replace best-path selection. BGP still marks one path as best for advertisement purposes, and advertises only that path unless additional-paths is configured. Other qualifying paths are installed alongside it for forwarding.

BGP table
  Path A: best, multipath
  Path B: multipath
  Path C: valid, not multipath

Routing table and CEF
  Next hop A
  Next hop B

Seeing several paths in the BGP table does not prove they are all installed in the RIB or used by CEF.

What makes BGP paths eligible for multipath

Candidate paths must tie through the best-path comparison up to the point where the final tie-breakers (oldest path, router ID, neighbor address) would choose between them. Multipath selection happens before those tie-breakers. Common reasons a path fails to qualify:

  • Different weight or local preference
  • Different locally originated status
  • Different AS-path length
  • For eBGP: a different AS-path sequence, including a different neighboring AS. bgp bestpath as-path multipath-relax relaxes this to equal length only.
  • Different origin code
  • Different MED, where MED is compared
  • A different IGP metric to the BGP next hop, for eBGP or iBGP candidates, unless an unequal-cost multipath feature is configured
  • An unsupported eBGP/iBGP combination
  • An unresolvable next hop, or a next hop that is not distinct from another path’s
  • A policy that intentionally prefers one path

In practice, the two that trip people up most are the neighboring-AS requirement for eBGP and an unequal IGP metric to the next hop, which matters most when BGP next hops resolve recursively through the IGP.

Standard BGP multipath shares traffic equally across the installed paths. For unequal sharing, Cisco’s BGP Link Bandwidth feature (bgp dmzlink-bw with neighbor dmzlink-bw) attaches the bandwidth of each external link as an extended community and weights traffic among paths that are otherwise multipath-eligible. It works with both eBGP and iBGP multipath; iBGP routers learn the bandwidth when extended communities are sent to them. It does not make ineligible paths eligible.

7. OSPF and IS-IS

OSPF installs multiple routes when several next hops reach a destination at the same total cost, up to the configured maximum. IS-IS behaves the same way with its metric.

router ospf 100
 maximum-paths 4

8. EIGRP and unequal-cost load sharing

EIGRP can install unequal-cost paths with variance, provided each path is a feasible successor. maximum-paths still caps the number installed, while variance controls which feasible paths qualify.

router eigrp 100
 maximum-paths 4
 variance 2

By default, EIGRP shares traffic across unequal paths in inverse proportion to their metrics (traffic-share balanced). The same syntax does not give BGP or OSPF unequal-cost forwarding.

9. What happens when one ECMP path fails

When an installed path becomes unusable, a detection mechanism (interface state, BFD, protocol timers, or next-hop tracking) triggers removal of that next hop from the RIB and FIB. Flows that were on the failed path are rehashed onto survivors. Whether flows on healthy paths also move depends on the hashing scheme.

Where supported, resilient hashing aims to preserve healthy-path assignments by remapping only the affected buckets, which reduces reordering and session disruption. The feature name, availability, defaults, and recovery behavior vary across Nexus, Catalyst, and IOS-XE router platforms.

Architect’s Note: plan for N-1 capacity. ECMP provides forwarding diversity and aggregate capacity. It does not automatically provide enough capacity after a failure. Two 10 Gbps circuits carrying a combined 16 Gbps both look healthy, but if one fails, 16 Gbps of demand lands on 10 Gbps of capacity. Size each ECMP group so the remaining members can carry peak load with one member down, or decide in advance which traffic QoS will protect when they cannot.

Does maximum-paths provide active-active forwarding?

Routing state Forwarding result
Two equal paths, maximum-paths 2 Both are active next hops
Two unequal paths, maximum-paths 2 Only the preferred path is installed (except EIGRP with variance)
Four equal paths, maximum-paths 2 Only two are installed
Four equal paths, maximum-paths 4 All four are active if the platform supports that width

Does it make convergence faster?

Not by itself. Having alternate paths already installed reduces the work needed after a failure, but convergence time is set by link-state detection, BFD timers, protocol failure detection, next-hop tracking, RIB and FIB update time, hardware ECMP group programming, and PIC or fast-reroute capabilities. maximum-paths is not a substitute for BFD, BGP PIC, or IP fast reroute.

10. How to verify ECMP

Question IOS / IOS-XE NX-OS
Did BGP select multipaths? show bgp ipv4 unicast <prefix> show bgp ipv4 unicast <prefix>
Are multiple next hops in the RIB? show ip route <prefix> show ip route <prefix>
Is CEF load sharing across them? show ip cef <prefix> detail show forwarding ipv4 route <prefix>
How are hash buckets mapped? show ip cef <prefix> internal Platform-specific hardware commands
Which next hop does a specific flow use? show ip cef exact-route <src> <dst> show routing hash <src> <dst>
What is the global hash mode? show running-config | include load-sharing show ip load-sharing

A healthy routing table shows multiple next hops for the prefix:

show ip route 203.0.113.0

Routing entry for 203.0.113.0/24
  Known via "bgp 65000"
  * 192.0.2.1
  * 192.0.2.5

show ip cef exact-route predicts the next hop for a source and destination pair. On releases that support it, add source and destination ports when include-ports is configured. The prediction may not reproduce every hardware hash field, so platforms using tunnel entropy or ASIC-specific fields may need hardware commands or traffic testing for full validation.

11. How to test ECMP correctly

A single ping, traceroute, or TCP session cannot prove ECMP distribution. The most common testing mistake is running parallel streams between one pair of hosts on a platform that hashes only IP addresses.

iperf3 -c 172.16.50.20 -P 8 -t 60

On a platform using an IP-only hash, such as classic IOS/IOS-XE router CEF with the default universal algorithm, all eight streams share the same source and destination IP, so they all hash to the same path every time. That result is correct behavior, not a fault. To get a meaningful test:

  • Generate traffic from several source addresses (multiple test hosts, or iperf3 -B bound to secondary addresses) toward several destinations
  • Use parallel streams only when you have confirmed the platform hashes Layer 4 ports
  • Collect interface counters on every ECMP member over the same test window
  • Use NetFlow or IPFIX to confirm which flows used which path
  • Check CEF and hardware forwarding state alongside the traffic results
  • Fail one member in a controlled way and measure packet loss and application continuity during convergence

Even with good flow diversity, the hash can place several flows on the same path. More flows improve the odds of an even spread but do not guarantee it.

12. Common misconceptions

Misconception Reality
maximum-paths 2 splits every connection in half Each flow hashes to one path. A single TCP stream uses one link.
maximum-paths makes unequal routes equal Paths must already satisfy the protocol’s multipath rules.
Four paths means 25 percent each Hashing distributes flows, and flow sizes vary widely.
Parallel streams always test ECMP Not on an IP-only hash. Streams between one host pair share a path.
Two BGP paths in the table means both are forwarding Verify the RIB, CEF FIB, adjacencies, and hardware entries.
More paths always means a better design More paths add capacity and redundancy, but also adjacency, policy, and troubleshooting complexity.
Per-packet is always better balanced It can balance bytes more evenly but risks reordering and lower TCP performance.

13. Choosing the value

Use maximum-paths 2 when two equivalent WAN or cloud connections should be active together, a distribution switch has two routed core uplinks, a router has two equivalent eBGP peers toward the same domain, or the topology only provides two independent next hops.

Use maximum-paths 4 when a leaf has four equal-cost spine next hops, a WAN edge has four policy-equivalent paths, or a fabric is designed for four-way ECMP and traffic diversity justifies it.

Keep a path out of the ECMP set when it has meaningfully different latency, lower bandwidth the platform cannot weight, metered cost, a less trusted provider or failure domain, different security inspection, asymmetric-routing consequences, different MTU, or a backup-only role.

Enforce the primary and backup relationship separately for each direction, because the tools are not interchangeable:

  • Outbound (your traffic leaving): weight, local preference, and IGP metrics act on your own routers’ path selection, so they give you direct control.
  • Inbound (traffic returning to your prefixes): AS-path prepending, MED, and provider communities only influence how other autonomous systems choose paths toward you. Providers’ own policies can override them, so they do not guarantee the inbound path.

Administrative distance is a different tool. It decides which routing source wins when different protocols offer the same prefix, such as an eBGP route versus a floating static backup. It does not choose between paths inside the same BGP process.

14. Design checklist

Area Validate
Protocol eligibility Metrics, BGP attributes, neighboring AS, IGP metric to next hop, next-hop resolution
Platform scale Maximum ECMP width, FIB and adjacency scale, hardware limits
Hash inputs Default algorithm, Layer 4 inclusion, tunnel, label, and inner-header support
Path equivalence Bandwidth, latency, MTU, security services, policy
Failure capacity Remaining members can carry peak load with one member down (N-1)
Failure detection Interface state, BFD, protocol timers, next-hop tracking, upstream convergence
Flow behavior Elephant flows, host-pair diversity, polarization, expected imbalance
Operations Per-link monitoring, telemetry, alerting, test method, rollback

Architect’s Note: equal cost does not mean equal capability. Two paths can satisfy every routing protocol requirement for ECMP while differing substantially in bandwidth, latency, congestion, security inspection, and failure characteristics. Routing eligibility is a protocol decision. Path equivalence is an architectural decision.

16. Conclusion

maximum-paths looks like a load-balancing command, but it is a routing control. It defines how many eligible paths may be installed for a destination. CEF and the forwarding hardware then decide how traffic uses them. On classic IOS/IOS-XE router CEF, that is a per-destination hash of source and destination IP unless Layer 4 ports are added; other platforms hash differently, so verify yours.

A successful ECMP design depends on correct route eligibility, knowing what the platform hashes, equivalent paths, enough flow diversity as the hash defines it, N-1 capacity, fast failure detection, and verification from the BGP table through the RIB, FIB, and hardware.