beautypg.com

Configuring the med attribute, Configuring the default med value – H3C Technologies H3C SR8800 User Manual

Page 236

background image

220

Configuring the MED attribute

MED is used to determine the best route for traffic going into an AS. When a BGP router obtains from

EBGP peers multiple routes to the same destination but with different next hops, it considers the route with

the smallest MED value as the best route if other conditions are the same.

Configuring the default MED value

To configure the default MED value:

Step Command

Remarks

1.

Enter system view.

system-view

N/A

2.

Enter BGP view.

bgp as-number

N/A

3.

Configure the default MED value.

default med med-value

Optional
0 by default

Enabling the comparison of MED of routes from different ASs

To enable the comparison of MED of routes from different ASs:

Step Command

Remarks

1.

Enter system view.

system-view

N/A

2.

Enter BGP view.

bgp as-number

N/A

3.

Enable the comparison of MED of
routes from different ASs.

compare-different-as-med

Not enabled by default

Enabling the comparison of MED of routes from each AS

Route learning sequence may affect optimal route selection.

Figure 86 Route selection based on MED

As shown in

Figure 86

, Router D learns network 10.0.0.0 from both Router A and Router B. Because

Router B has a smaller router ID, the route learned from it is optimal.

Network NextHop MED LocPrf PrefVal Path/Ogn

*>i 10.0.0.0 2.2.2.2 50 0 300e

* i 3.3.3.3 50 0 200e

AS

AS 300

AS 100

AS 200

Router A

Router D

Router ID: 3.3.3.3

Router C

Router B

GE3/1/0

2.2.2.2/24

Router ID: 1.1.1.1

Router ID: 2.2.2.2

1.1.1.1/24

GE3/1/0

3.3.3.3/24

GE3/1/0