BGP Path Attributes - Multi-Exit Discriminator (MED)
ccnp-routing
How the Multi-Exit Discriminator attribute lets a dual-homed enterprise tell its ISP which inbound link to prefer, with route map configuration.
- An enterprise has much less control over inbound routes (routes for packets coming back toward the Enterprise) because these inbound routes exist on routers that the enterprise does not own.
- MED is a tool that allows some control over the last ASN hop between an ISP and their enterprise customer.
- MED originally worked for a dual-homed design.
- We have 1 ISP but multiple links to the ISP.
- We want to tell the ISP which link we prefer over the others.
- Remember we do not own ISP routers. We want to advertise MED to tell the ISP which path we prefer.
- The lower the MED, the better
- Default is 0
- Configuration is done by route-map
R5#show ip bgp 12.12.12.0/24 longer-prefixes
BGP table version is 26, local router ID is 5.5.5.5
Network Next Hop Metric LocPrf Weight Path
* i 12.12.12.0/24 4.4.4.4 0 100 0 64500 i
*> 2.2.2.2 0 0 64500 i
Now we want ISP1 to send us traffic over the upper link, meaning that R5 also has to send the traffic to R4. But we do not manage ISP routers. We want to configure R2 which we have access to.

R2(config)#ip prefix-list PrefixMED seq 10 permit 12.12.12.0/24 R2(config)#ip prefix-list NET13 permit 13.13.13.0/24 R2(config)#route-map RmMED10 permit 10 R2(config-route-map)#match ip address prefix-list PrefixMED R2(config-route-map)#set metric 10 R2(config-route-map)#exit R2(config)#route-map RmMED20 permit 10 R2(config-route-map)#match ip address prefix-list PrefixMED R2(config-route-map)#set metric 20 R2(config-route-map)#exit R2(config)#route-map RmMED20 permit 20 R2(config-route-map)#match ip address prefix-list NET13 R2(config-route-map)#exit R2(config)#ip prefix-list NET13 permit 13.13.13.0/24 R2(config)#route-map RmMED10 permit 20 R2(config-route-map)#match ip address prefix-list NET13 R2(config)#router bgp 64500 R2(config-router)#neighbor 4.4.4.4 route-map RmMED10 out R2(config-router)#neighbor 5.5.5.5 route-map RmMED20 out R2(config-router)#end R2#clear ip bgp 4.4.4.4 soft R2#clear ip bgp 5.5.5.5 soft
R5#show ip bgp 12.12.12.0/24 longer-prefixes
BGP table version is 31, local router ID is 5.5.5.5
Network Next Hop Metric LocPrf Weight Path
*>i 12.12.12.0/24 4.4.4.4 10 100 0 64500 i
* 2.2.2.2 20 0 64500 i
Back to top