default med (BGP-VPN-Target address family view)

Function

The default med command configures a MED for BGP routes.

The undo default med command restores the default value.

By default, the MED value of an imported route equals the cost of the imported route; the MED value carried in a route learned.

Format

default med med

undo default med

Parameters

Parameter Description Value
med

Specifies the MED for BGP routes.

The value is an integer ranging from 0 to 4294967295.

Views

BGP-VPN-target address family view

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
bgp write

Usage Guidelines

Usage Scenario

The default med command applies only to the routes imported using the import-route command and BGP summary routes.

After the default med command is run, the BGP routes that the local device sends to its BGP peers carry the MED, which helps control route selection for the traffic entering the local 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 more than one MED is configured for BGP routes, the latest configuration overrides the previous one.

Precautions

The MED attribute is transmitted only between two neighboring ASs. The AS that receives the MED attribute does not advertise it to a third AS.

Example

# Set the MED of BGP routes to 10.
<HUAWEI> system-view
[~HUAWEI] bgp 100
[*HUAWEI-bgp] ipv4-family vpn-target
[*HUAWEI-bgp-af-vpn-target] default med 10
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >