OSPF ECMP Explained: Equal-Cost Routes, Load Sharing and Troubleshooting
Short answer: OSPF can retain several paths to the same destination when their path type and total cost are equal; equal-looking interface speeds alone are not enough.[1] A forwarding engine then chooses how packets use those next hops, so two installed routes do not prove a 50/50 traffic split.[2]
This guide separates three questions: did OSPF calculate equal paths, did the router install both, and did the forwarding plane actually use them? The reusable asset is a four-router lab and an acceptance checklist, not a fabricated device transcript.
Why OSPF ECMP is not a bandwidth guarantee
ECMP means equal-cost multipath. OSPF first distinguishes path types, including intra-area, inter-area and external routes; comparing just the displayed metric across different types is misleading.[1] For the same eligible destination and path type, equal accumulated costs can produce multiple next hops.[1]
On Cisco, maximum-paths limits the number of parallel routes that may be installed; the supported limit depends on the software/platform.[4] FRRouting also exposes an OSPF maximum-paths setting, with a documented upper bound affected by its build-time multipath limit.[3] Neither command makes an unequal path equal.[3][4]
Cisco's CEF explanation distinguishes path installation from forwarding and describes source/destination-based sharing that can look uneven with only a few communicating pairs.[2] It is a historical conceptual reference, not a promise about every modern ASIC's hash fields or default settings. Verify those on the actual device before using utilization as an acceptance criterion.
Original lab: two equal paths to a remote loopback
The following is a proposed OSPFv2 area 0 lab. All links are routed point-to-point Ethernet. Interface names must be adapted to the image. Use an isolated lab before considering a production change.
R2
/ \
R1 R4 -- Loopback0 192.0.2.4/32
\ /
R3
R1 Gi1 10.15.12.1/30 -- R2 Gi1 10.15.12.2/30
R1 Gi2 10.15.13.1/30 -- R3 Gi1 10.15.13.2/30
R2 Gi2 10.15.24.1/30 -- R4 Gi1 10.15.24.2/30
R3 Gi2 10.15.34.1/30 -- R4 Gi2 10.15.34.2/30
All transit interface costs: 10
R4 loopback cost: 1
Our expected forward-path arithmetic is 10 + 10 + 1 = 21 through either branch. These are designed expectations, not measured route output. The loopback and link costs are explicit so the exercise does not depend on a reference-bandwidth default.
Cisco IOS XE-style configuration
Build R1 as follows. This is an original configuration template using the parallel-path control described in Cisco's routing guide.[4]
interface GigabitEthernet1
description LAB-R1-R2
ip address 10.15.12.1 255.255.255.252
ip ospf 15 area 0
ip ospf network point-to-point
ip ospf cost 10
no shutdown
!
interface GigabitEthernet2
description LAB-R1-R3
ip address 10.15.13.1 255.255.255.252
ip ospf 15 area 0
ip ospf network point-to-point
ip ospf cost 10
no shutdown
!
router ospf 15
router-id 192.0.2.1
passive-interface default
no passive-interface GigabitEthernet1
no passive-interface GigabitEthernet2
maximum-paths 2
Apply the same transit-interface template on R2, R3 and R4, using the addressing plan above. Give them router IDs 192.0.2.2, 192.0.2.3 and 192.0.2.4 respectively. Enable both transit interfaces under OSPF, with point-to-point type and cost 10; exempt both from passive-interface default. Set maximum-paths 2 on each router for consistency.
On R4, add the destination:
interface Loopback0
ip address 192.0.2.4 255.255.255.255
ip ospf 15 area 0
ip ospf cost 1
Keep that loopback passive. For a bidirectional test between router loopbacks, also create and advertise Loopback0 on R1 with 192.0.2.1/32 and cost 1. Do not assume that setting router-id creates or advertises an interface address.
FRRouting 10.1 alternative for R1
Provision Linux addresses first: eth1 = 10.15.12.1/30 and eth2 = 10.15.13.1/30. Enable Linux IPv4 forwarding and FRR's zebra/ospfd daemons. This is an alternative R1, not an additional router in the topology.
The configuration uses FRR's interface-based area activation and OSPF multipath setting.[3]
interface eth1
ip ospf area 0
ip ospf network point-to-point
ip ospf cost 10
!
interface eth2
ip ospf area 0
ip ospf network point-to-point
ip ospf cost 10
!
router ospf
ospf router-id 192.0.2.1
maximum-paths 2
For this isolated two-interface example, only the listed transit interfaces participate. If adding LANs, management interfaces or loopbacks, design passive-interface policy explicitly rather than copying unrelated interface defaults.
Follow the route: control plane, installation, forwarding
OSPF's ECMP calculation can retain multiple next hops; it does not prescribe a universal packet hash for every forwarding implementation.[1][2] Treat the following as separate checkpoints:
- OSPF: inspect neighbors and link costs against the lab plan.
- Routing table: look for two next hops for exactly 192.0.2.4/32.
- Forwarding table: confirm both next hops resolve to usable egress adjacencies.
- Traffic: generate multiple independent conversations and compare counter deltas over a recorded interval.
Do not paste an illustrative route line into an incident record as observed evidence. Save actual outputs with device, timestamp, VRF and software version.
Cisco verification commands
Cisco documents CEF route inspection and exact-route checks as tools for analyzing parallel-path forwarding.[2] Use supported equivalents if the platform uses a different hardware-forwarding CLI.
show ip ospf neighbor
show ip ospf interface GigabitEthernet1
show ip ospf interface GigabitEthernet2
show ip route 192.0.2.4
show ip cef 192.0.2.4 detail
show ip cef exact-route 192.0.2.1 192.0.2.4
show interfaces GigabitEthernet1
show interfaces GigabitEthernet2
Expected lab logic: R1 has Full neighbors on both point-to-point links; the destination has two next hops, 10.15.12.2 and 10.15.13.2, at metric 21; forwarding resolves both branches. An exact-route lookup for one address pair can select one branch without contradicting ECMP.
FRRouting and Linux checks
Use this collection plan on the alternative R1:
vtysh -c 'show ip ospf neighbor'
vtysh -c 'show ip route 192.0.2.4/32'
ip -4 route show 192.0.2.4/32
ip -4 route get 192.0.2.4 from 10.15.12.1
Compare OSPF/FRR route selection with the Linux forwarding entry. A single route get lookup is a sample, not proof that every flow or every kernel implementation will use both paths.
Outbound control, inbound influence and hard limits
Outbound: changing R1's outgoing OSPF costs changes its SPF comparison; OSPF link costs are directional.[1] In the proposed lab, raise only R1 Gi1's cost to 20:
interface GigabitEthernet1
ip ospf cost 20
The expected R1-to-R4 costs become 31 via R2 and 21 via R3. Check for one preferred next hop via R3, then restore ip ospf cost 10. Leave maximum-paths 2 unchanged: this experiment distinguishes path eligibility from installation capacity.
Inbound: remote routers calculate their own routes from the topology and costs they see.[1] For an inbound experiment, leave R1 unchanged and raise R4's cost toward R2 to 20. With the optional R1 loopback present, expect R4's path to R1 to prefer R3. Record both directions before and after; do not treat an R1-only cost edit as a return-path policy.
Cannot control: OSPF ECMP is not Internet inbound engineering, application-aware steering, or a guarantee of symmetric firewall traversal. Cisco's forwarding discussion also warns that per-packet sharing can reorder packets.[2] Do not enable per-packet sharing merely to improve a utilization graph. Document stateful middleboxes and both traffic directions before approving multipath.
Troubleshooting checklist: why only one link is busy
Use the first failing checkpoint to narrow the incident:
- No adjacency on a branch: check addresses, area, passive state, timers, authentication, network type and MTU before changing ECMP policy.
- Different candidate costs: add every outgoing link cost along each proposed path, including the destination attachment; do not compare only R1's first hop.
- Different route types: compare path type as well as metric; OSPF's selection hierarchy precedes equal-cost sharing.[1]
- One next hop despite equal candidates: inspect
maximum-pathsand device limits.[3][4] - Two routing next hops, one forwarding next hop: collect adjacency resolution and forwarding-programming evidence.
- Two forwarding next hops, uneven counters: vary communicating address pairs; a small set can distribute unevenly under CEF's documented sharing model.[2]
- One test transfer never exceeds one branch: do not use that alone as a failed ECMP result; record its endpoints and compare with a multi-conversation test.[2]
- Unexpected return path or firewall drops: inspect the reverse route and security path separately before changing forward metrics.
Acceptance matrix for this lab
| Test | Planned acceptance condition |
|---|---|
| Baseline topology | Both branch adjacencies are Full |
| Equal-cost route | R1 has both specified next hops at metric 21 |
| Forwarding resolution | Both next hops resolve without unresolved adjacency |
| R1 Gi1 cost raised to 20 | Forward route prefers R3; restore afterward |
| R1 Gi1 shut in the lab | Remote loopback remains reachable after convergence via R3 |
| R1 Gi1 restored | Both next hops return after convergence |
| Multiple conversations | Collect path counters; do not require an exact 50/50 split |
| Return-path check | Record remote forwarding decisions independently |
Shut interfaces only in the isolated lab or an authorized maintenance window. No failover duration is promised here; measure it using timestamped traffic and routing evidence.
Modern use: enterprise cores and transport underlays
As a design exercise, use this checklist for an enterprise core or an OSPF transport underlay that must reach remote tunnel endpoints. Keep transport reachability, overlay route exchange and application performance as separate acceptance items. This article does not configure EVPN, Cisco ACI, cloud routing services or an ISP policy, and passing its OSPF checks does not certify those systems.
Interview answer
OSPF ECMP means several eligible paths of the same path type and cost can supply next hops for one destination.[1] The installation limit and forwarding behavior are separate checks.[2][4] I would verify neighbors, total costs, route type, routing and forwarding entries, then test multiple conversations and the return path rather than demanding equal interface counters.
Summary
Use this order during diagnosis: topology → equal candidate paths → installation limit → forwarding resolution → traffic distribution → return path. Preserve the distinction between an original lab's expected result and an observed production result.
Related reading
- OSPF Cost and Reference Bandwidth: Fix Path Selection and Asymmetric Routing
- OSPF Passive Interface Explained: Advertise Subnets Without Neighbors
- OSPF Route Filtering Explained: Distribute Lists vs ABR Filter Lists
Validation note: These are original proposed configurations and expected outcomes. No router, emulator, packet capture or throughput test was run for this article. Local checks validate the artifact, source evidence, addressing and links only.
Sources
- RFC 2328 — OSPF Version 2
- Cisco — Troubleshooting Load Balancing Over Parallel Links Using CEF
- FRRouting 10.1 — OSPFv2
- Cisco IOS XE — Protocol-Independent Routing Features
Try it: OSPF Cost Calculator - free, runs in your browser.
Related reading
- OSPF Passive Interface Explained: Advertise Subnets Without Neighbors
- OSPF Default Route Origination: Always, E1/E2 and IP SLA
- OSPF Route Filtering Explained: Distribute Lists vs ABR Filter Lists
- OSPF Authentication Explained: HMAC-SHA-256, Key Chains and Safe Migration
- OSPF Summarization Explained: ABR area range, ASBR Summaries and Blackholes
- OSPF Cost and Reference Bandwidth: Fix Path Selection and Asymmetric Routing
Comments
Post a Comment