MED (Multi-Exit Discriminator) suggests to your neighbor which entry point to use when reaching you. Lower values are preferred.
Scope: Sent to eBGP peers but only compared for routes from the same neighboring AS.
Example use case: You peer with ISP-X at locations: New York and Los Angeles.
- Announce your prefix from NY with MED
- Announce from LA with MED
ISP-X should prefer sending traffic to you via New York.
The catch: MED is a suggestion. Your neighbor can ignore it. LOCAL_PREF on their side overrides your MED. Use MED when you and your neighbor cooperate on traffic engineering.