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

Articles are written in English. The Thai translation button opens Google Translate; code and commands stay in their original form.

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 · 1 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.

What to check first

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.

What the results mean

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 know how to undo the change

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