bgp always-compare-med

This command specifies whether to compare MEDs when multiple routes with differing MEDs are received from peers in different Autonomous Systems.

Syntax

bgp always-compare-med
no bgp always-compare-med

Parameters

None.

Defaults

None.

Mode

BGP Router Configuration.

Usage

MEDs are used when an AS has multiple connections to another AS. Routes are advertised on both connections with different MEDs to specify a preferred path, typically for purposes of load balancing. Typically, the MED for routes from different Autonomous Systems to the same destination are not compared. When two routes to the same destination are received from peers in different Autonomous Systems, the bgp always-compare-med command allows you to specify whether to compare those MEDs. When choosing between these routes, assuming that nothing else makes one preferable to the other (such as a configured policy), the values of the differing MEDs are used to choose the route to use. In this comparison, the route with the lowest MED is preferred.

Routes without MEDs are treated as having the best possible MED.

The no bgp always-compare-med command resets the always compare MED feature to the default value of disabled.

Example

The following example enables the comparison of MEDs from different ASs:

System(su-config)->router bgp 65151
System(su-config-bgp)->bgp always-compare-med
System(su-config-bgp)->