MED: a value that can influence the neighboring autonomous systems routing process when there are multiple entry points into the autonomous system.

The Multiple Exit Discriminator, or MED, is an optional non-transitive attribute. The value of the MED is a four-octet number, called a metric. When multiple routing entries exist, the route with the lowest MED value should be used.

The example below is an illustration of how the MED could be used:


There are two links present between AS 2 and AS1. EBGP sessions are established across both links. The administrator of AS2 would like all inbound traffic into the AS to traverse the link between R1 and R3.

To achieve this, the administrator applies an export policy on R3 that advertises the AS2 prefix with a MED value of 100. At the same time, another export policy is applied to R4. That export policy sets the MED to 500.

As soon as both R3 and R4 begin advertising the AS2 prefixes towards AS1, AS1 will have two routes available. One route into AS1 is learned from R3 and the other one is learned from R4. Since entering AS2 via R4 will be less attractive due to higher MED value, the route learned from R3 will be used.

Of course, the administrator of AS1 can have other plans. He might set the local preference of all routes received from R4 to a value higher than the routes received from R3. If that is the case, the MED is ignored and traffic inbound to AS2 will traverse the link between R2 and R4.