BGP ECMP Configuration: Cisco, Juniper and Arista - 夜莺博客

BGP ECMP Configuration: Cisco, Juniper and Arista

BGP Equal-Cost Multi-Path (ECMP) turns idle parallel links into active capacity: traffic spreads across multiple equal-cost paths, improving utilization and resilience. But every platform implements it differently, and small mistakes silently break load balancing. This tutorial covers BGP ECMP configuration on Cisco IOS, Juniper Junos and Arista EOS with the exact commands, common pitfalls, and the operational habits that keep ECMP healthy.

Why BGP ECMP Matters

Without ECMP, BGP installs a single best path and all other equal-cost paths sit unused. With ECMP, the router installs multiple next-hops for the same prefix and load-balances across them — better resource utilization, faster convergence on link failure, and no wasted bandwidth on redundant uplinks.

Cisco: maximum-paths in the BGP Process

router bgp YOUR-ASN
 neighbor 192.168.1.1 remote-as 100
 neighbor 192.168.1.2 remote-as 100
 maximum-paths 4

After configuring neighbors, maximum-paths 4 allows up to four parallel paths. Tune the number to your hardware's ECMP capability and network requirements.

Juniper: Policy-Driven Load Balancing

set routing-options forwarding-table export ECMP-RULE
set policy-options policy-statement ECMP-RULE term 1 from protocol bgp
set policy-options policy-statement ECMP-RULE term 1 then load-balance per-packet

Junos does not have a simple maximum-paths knob — ECMP is driven by a forwarding-table export policy that matches BGP routes and applies load balancing. Apply it per routing instance/VRF where needed.

Arista: maximum-paths with ECMP Tuning

configure terminal
router bgp YOUR-ASN
 neighbor IP-ADDRESS remote-as PEER-ASN
 maximum-paths 4

EOS supports the same maximum-paths command plus deep ECMP control: bgp bestpath ecmp-fast (ignore arrival order in ECMP evaluation), tie-breakers like bgp bestpath tie-break router-id, and rib fib fec ecmp ordered for deterministic next-hop ordering. Verify with show ip bgp — ECMP paths are marked ECMP head / ECMP contributor.

Common Mistakes and Best Practices

  • Inconsistent routing policies across paths cause asymmetric routing or flapping — keep policies uniform.
  • Verify ECMP at the forwarding level, not just the BGP table; a missing load-balance policy on Junos leaves all traffic on one path.
  • Document configurations and audit regularly; ECMP breaks subtly during firmware upgrades if capabilities change.
  • Monitor per-path utilization — imbalance usually signals a hash or policy issue.

For adjacent topics see BGP neighbor flapping root causes, BGP in EVPN data center fabrics and the Arista EOS troubleshooting cookbook.

原文链接:https://netseccloud.com/configuring-bgp-ecmp-step-by-step-tutorial