< Home

default med (BGP)

Function

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.

Format

default med med

undo default med

Parameters

Parameter Description Value

med

Specifies the default MED value of a BGP route.

The value is an integer that ranges from 0 to 4294967295.

Views

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

Default Level

2: Configuration level

Usage Guidelines

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.

Example

# Configure the default MED value of a BGP route that will be sent to its BGP peers to 10.

<sysname> system-view
[sysname] bgp 1
[sysname-bgp] ipv4-family unicast 
[sysname-bgp-af-ipv4] default med 10
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >