< Home

default med

Function

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.

Format

default med med

undo default med

Parameters

Parameter Description Value
med Specifies the MED for BGP routes. The value is an integer that ranges from 0 to 4294967295.

Views

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

Default Level

2: Configuration level

Usage Guidelines

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.

Example

# Set the default MED of a BGP route to 10.

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