πŸ—“οΈ Aug 15, 2007⏱️ 2 min read

BGP Path Selection in Dual-Homed WANs: Why Deterministic MED Prevents Oscillation

How non-deterministic BGP MED comparisons cause route oscillation across dual-homed enterprise WAN links, and why bgp deterministic-med stabilizes inbound traffic.

πŸŽ™οΈ Listen to ArticleREADY
AI Audio Synthesis Narrator
Share Post:

β€œWhen two upstream providers advertise identical prefixes with different MED values, the order in which BGP learns those routes should never dictate where your traffic exits.”

The Failure Mode: Order-Dependent Best-Path Selection

In dual-homed enterprise edge topologies, engineers routinely use Multi-Exit Discriminator (MED) to influence inbound path preference across two links to the same Autonomous System. Without bgp deterministic-med enabled, classic BGP implementations compare routes in chronological arrival order rather than grouping candidates by neighboring AS first.

If an upstream peer flaps, the arrival order changes. A route from AS 65001 that previously lost to AS 65002 can suddenly win, triggering asymmetric routing and intermittent TCP drops across stateful edge firewalls.

Architectural Fix

  1. Enable bgp deterministic-med globally on every border router so paths are grouped by neighbor AS before MED evaluation.
  2. Avoid bgp always-compare-med unless both upstream ISPs explicitly coordinate their internal IGP metrics (which is rare in multi-carrier WANs).
  3. Pair with Local Preference for outbound determinism: Use LOCAL_PREF inside your AS for outbound steering and reserve MED strictly for inbound hints to a single carrier.

Verification

  • Run show ip bgp <prefix> before and after a controlled peer soft-reset (clear ip bgp <peer> soft in).
  • Confirm the best-path selection remains identical regardless of peer session uptime.
EDGE RAG DEEP-LINK

πŸ€– Interrogate This Field Note in Digital Twin

Open in /twin ↗

Click a prompt below to immediately stream an architectural analysis from Virtual Sachin's RAG cognitive twin:

SKS

Sachin Kumar Sharma

Director (Cloud & Infrastructure Architecture) | Principal Agentic AI Architect | 20+ Yrs Exp

Architecting resilient multi-cloud enterprise landing zones, SDN overlay fabrics, DevSecFinOps automation pipelines, and autonomous Agentic AI platforms.

πŸ“¬

πŸ“¬ Stay Updated on Tech Releases

Sign up to get notified when I publish new production war stories, agentic AI architecture blueprints, or open-source infrastructure tools.

⚑ Theme Adaptive Shift
Switching layouts matching domain reading affinity...