No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search


To have a better experience, please upgrade your IE browser.


How to Load Balance Ingoing Traffic Using the MED?

Publication Date:  2013-01-07 Views:  113 Downloads:  0

Issue Description

A country's Internet is connected to M country through two links and connected to C country through one link. All links are connected to C-Router before a cutover. The two links that are connected to M country are cut to the Huawei router (an NE40E) while the link connected to C country is cut to the C7206 after the cutover.

The outgoing traffic does not learn the exact routing entries of the Internet but uses the default routes to M country and C country. Before the cutover, the incoming traffic is load balanced across the two links based on the 2:1 bandwidth ratio. After the cutover, all the incoming traffic on the NE40E is directed to POS 1/0/2. The traffic rate is about 120 Mbit/s and the peak information rate (PIR) is 150 Mbit/s. However, POS 1/0/1 forwards only 1 to 3 Mbit/s traffic. As a result, the traffic is severely unbalanced. It is only certain that the peer end is a non-Huawei device, but the configuration is not clear.

Handling Process

Since the non-Huawei device is located in another country, it is considered to change the MED value to affect the route selection on the peer end and therefore affect the incoming traffic.


Select some of the advertised routes destined for the network segment and change the MED value to 500. Set the MED value of the routes destined for other network segments to 0. In this way, the incoming traffic destined for this network segment is directed to another link.

An example configuration is shown as follows.

ip ip-prefix med-prefix index 10 permit X.Y.128.0 20

route-policy med-500 permit node 10

if-match ip-prefix med-prefix

apply cost 500

route-policy med-500 permit node 15

apply cost 0

ipv4-family unicast

peer A.B.254.241 route-policy med-500 export

If the traffic volume does not increase remarkably on another link, add the network segment in the ip prefix for modification until the traffic is balanced across the links.

After the preceding configuration is complete, POS 1/0/1 forwards incoming traffic, proving that the modification succeeds.

Root Cause

The cause for this problem lies in that the BGP selects the optimal path during route selection.

The maximum-paths n command is not configured on the peer device


Modify the local MED value to affect the route selection on the peer end and further to affect the forwarding of incoming traffic.



In this case, how to process the unselected network segments is the key to resolve the problem. In the same routing policy, if the ip prefix is not specified but the MED value is set to 0, route selection can be affected.