The default med command sets the default multi-exit-discriminator (MED) for BGP routes.
The undo default med command restores the default configuration.
By default, the MED is 0.
Parameter | Description | Value |
---|---|---|
med | Specifies the MED for BGP routes. | The value is an integer that ranges from 0 to 4294967295. |
BGP view, BGP-IPv4 unicast address family view, BGP-IPv4 multicast address family view, BGP-VPN instance IPv4 address family view, BGP-VPNv4 address family view, BGP-IPv6 unicast address family view, BGP-VPN instance IPv6 address family view, BGP-VPNv6 address family view
Usage Scenario
The default med command is valid only for the routes imported by using the import-route (BGP) command and the routes summarized by BGP on the local device.
The default med command sets the default MED and controls route selection for the traffic entering an AS. If the other attributes of routes to the same destination are the same, BGP will select the route with the smallest MED as the optimal route.
Precautions
If a default MED is configured on a device, configuring a new default MED will override the previous configuration and the new default MED will overwrite the previous one.
The MED is transmitted between two neighboring ASs only. Devices in an AS do not advertise the received MED to peers in other ASs.