Table 8-28
Methods to modify the MED value
Method
Usage Scenario
Run the
default med
command.
This method sets a default MED for all the
routes that the local device advertises to its
BGP peers. The
default med
command takes
effect only with the routes imported locally
using the
import-route
command and BGP
summarized routes.
Configure an import or export policy and run
the
apply cost
command to configure an
apply clause for the policy.
This method sets different MED values for
different routes advertised by the local device
to its EBGP peers.
Configure an export policy and run the
apply
cost-type
internal
command to configure an
apply clause for the export policy.
This method enables a device to set MED
values for the BGP routes that are learned
from IBGP peers and to be advertised to
EBGP peers and match the export policy to
the costs of the IGP routes to which the BGP
routes are iterated.
The major points about MED attributes that require consideration are as follows:
l
If routes are received from different ASs, traffic will be sent to different ASs. In addition,
BGP selects the optimal route only from the routes destined for the same address. Therefore,
BGP only compares the MEDs of routes that are from the same AS (excluding confederation
sub-ASs). MEDs of two routes are compared only if the leftmost AS number in the
AS_Sequence (excluding AS_Confed_Sequence) of one route is the same as its counterpart
in the other route.
l
If the
compare-different-as-med
command is run, BGP compares MEDs of routes even
when the routes are received from peers in different ASs. Do not run this command unless
the ASs use the same IGP and route selection mode. Otherwise, a routing loop may occur.
l
If a route does not carry MED, BGP uses the default value (0) as the MED of the route
during route selection. If the
bestroute med-none-as-maximum
command is run, BGP
considers the largest MED value (4294967295) to be the MED of the route.
l
After the
bestroute med-confederation
command is configured, BGP compares the MEDs
of routes only when the AS_Path attributes of the routes carry no external AS numbers
(ASs that do not belong to the confederation) and the leftmost AS numbers in each
AS_Confed_Sequence are the same.
l
After the
deterministic-med
command is configured, routes will not be selected in the
same sequence they are received.
In
, ISP1 and ISP2 can learn the route 1.1.1.9/32 from Router C or Router D.
HUAWEI NetEngine80E/40E Router
Configuration Guide - IP Routing
8 BGP Configuration
Issue 02 (2014-09-30)
Huawei Proprietary and Confidential
Copyright © Huawei Technologies Co., Ltd.
940