
ip address 200.1.3.2 255.255.255.0
#
bgp 30
router-id 3.3.3.3
peer 200.1.3.1 as-number 20
#
ipv4-family unicast
undo synchronization
import-route direct
peer 200.1.3.1 enable
#
return
8.28.4 Example for Configuring MED Attributes to Control BGP
Route Selection
Multi_Exit Discriminator (MED) attributes can be used to control BGP route selection.
Networking Requirements
The MED attribute equals a metric used in an IGP, and is used to determine the optimal route
for traffic that enters an AS. When a BGP device obtains multiple routes to the same destination
address but with different next hops from EBGP peers, the route with the smallest MED value
is selected as the optimal route.
On the network shown in
, BGP is configured on all routers. router A is in AS 65008.
Router B and Router C are in AS 65009. Router A establishes EBGP connections with Router
B and Router C. Router B establishes an IBGP connection with Router C. Traffic sent by
Router A to destination 9.1.1.0 can enter AS 65009 through Router B or Router C. If the attributes
excluding the MED values of the routes advertised by Routers B and C to Router A are the same,
you can change the MED value of the route to be advertised by Router B or Router C to
Router A in order to determine the device through which traffic will enter AS 65009.
Figure 8-32
Networking diagram for configuring MED attributes of routes to control route
selection
POS1/0/0
200.1.1.2/24
POS2/0/0
200.1.2.2/24
POS2/0/0
200.1.1.1/24
RouterB
GE1/0/0
9.1.1.1/24
AS 65009
GE1/0/0
9.1.1.2/24
RouterC
POS2/0/0
200.1.2.1/24
RouterA
AS 65008
EBGP
EBGP
IBGP
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.
974