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