The BGP multiple exit discriminator (MED, or
MULTI_EXIT_DISC) is an optional path attribute that can be included in BGP update messages. This attribute is used on external BGP links (that is, on inter-AS links) to select among multiple exit points to a neighboring AS. The MED attribute has a value that is referred to as a metric. If all other factors in determining an exit point are equal, the exit point with the lowest metric is preferred.If a MED is received over an external BGP link, it is propagated over internal links to other BGP systems within the AS.
BGP update messages include a MED metric if the route was learned from BGP and already had a MED metric associated with it, or if you configure the MED metric in the configuration file in one of the following ways:
For configuration examples, see Examples: Configuring the MED Metric.
A MED metric is advertised with a route according to the following general rules:
- A more specific metric overrides a less specific metric. That is, a group-specific metric overrides a global BGP metric and a peer-specific metric overrides a global BGP or group-specific metric.
- A metric defined with routing policy overrides a metric defined with the
metric-outstatement.- If any metric is defined, it overrides a metric received in a route.
- If the received route did not have an associated MED metric, and if you did not explicitly configure a metric, no metric is advertised.
For a description of the algorithm used to determine the active path, see How the Active Route Is Determined.