Merry Christmas & Happy 2027! Less downtime. More good times. Celebrating 13 years of sorlavit.com
Skip to content
Sorlavit KimIT Support, Network & Infrastructure Services Let’s talk

ปุ่มแปลไทยจะเปิดบทความผ่าน Google Translate เพื่อแปลอัตโนมัติ โดยคงโค้ดและคำสั่งไว้ตามต้นฉบับ

Network & Infrastructure / BGP Policy & Internet Edge

LOCAL_PREF and MED: explain why the cheaper exit loses

An enterprise expects traffic to use the neighbor advertising a smaller MED, but the selected route exits elsewhere. A higher-priority policy attribute may already have decided the comparison.

Compiled for Sorlavit Kim · Published · Updated · 2 min read

Environment and inputs: BGP speakers and route reflectors; policy syntax, RPKI integration and address-family behavior depend on the implementation. Diagnostic/design example; not tested on production equipment.

Collect the evidence

Capture all candidate paths and their local preference, AS path, origin, MED and next-hop reachability. Record whether the router compares MED across different neighboring ASes.

Explain the result

Selection is ordered, and MED comparison is not universally global. A local-preference difference typically decides before MED; vendor-specific options can alter later comparisons.

Plan the fix

Write the desired outbound policy explicitly and review which attribute represents it. Adjust only the intended peer or prefix class rather than enabling global comparison changes without modeling them.

Check the result and rollback

Verify selected routes for competing exits and measure the application path after each failure scenario. Revert if unrelated prefixes shift or inbound traffic is mistakenly assumed to follow outbound policy.

Share this article

Back to all articles