BGP — MED for egress tiebreak
- Routing
- Intermediate
- 8 min
- 2 steps
- Cisco IOS-style
R1 advertises 192.168.1.0/24 to R2 with MED 50 via outbound route-map. MED is the lowest-priority tiebreak in BGP best-path selection — useful when other attributes (Weight, Local-pref, AS-path, Origin) are equal across two egress paths to the same destination AS.
Open this lab in your browser →
Free · no install · no account
Scenario
MED (Multi-Exit Discriminator) is BGP's "hint to the neighbour AS about which exit to prefer." Lower wins. MED matters when: - Two ASes peer over multiple links to each other. - Both peers receive the same prefix on both links. - Other attributes (Weight, Local-pref, AS-path length, Origin) are all tied. Then MED is the tiebreak: lowest MED wins. Set MED via outbound route-map on the side that wants its peer to prefer one egress over another: `` route-map TO-R2 permit 10 set metric 50 ← writes the MED on outbound advertisements `` In this lab there's only one R1↔R2 path, so MED won't actually influence path selection — but the configuration shape (route-map → set metric → neighbor out) is identical to a multi-homed scenario.
Topology
2 × router · Cisco IOS-style
R1— routerR2— router
What you will do
On
R1, defineroute-map MED-OUT permit 10withset metric 50and bind outbound to R2.On
R2, runshow ip bgp 192.168.1.0. The detail view should reportMED 50on R1's advertisement.
Open this lab in your browser →
More labs on this topic
- Syntax delta — static route (Extreme EXOS)Beginner · 4 min
- Syntax delta — static route (Cisco IOS)Beginner · 4 min
- Syntax delta — static route (Juniper Junos)Beginner · 5 min
- Syntax delta — static route (VyOS)Beginner · 5 min
- Static routes — fix hub-and-spokeBeginner · 12 min
- Static routes — egress-interface form (point-to-point)Beginner · 8 min
This lab in other languages
BGP — MED als Egress-TiebreakBGP — MED para desempate de salidaBGP — MED para desempate de saídaBGP — MED pour départager les sortiesBGP — egress tiebreak के लिए MEDBGP — 出方向决胜用的 MEDBGP — MED come tiebreak di egressBGP — エグレスのタイブレイクに使う MEDBGP — egress 타이브레이크용 MEDBGP — MED как тай-брейк egressBGP — egress tiebreak için MEDBGP — MED làm tiebreak cho egress