When there are multiple routes to the same destination, we need to compare their route preferences and link costs to select the optimal route. If the preferences are the same, the system selects the route with the smallest link cost; if the link costs are the same too, the routes participate in load balancing.
On Huawei devices, route preferences are compared twice: First, compare the external preferences. If the external preferences are the same, compare the internal preferences.
The external preference refers to the preference that can be configured by users for each routing protocol (except for direct routes).
For example, set the default preference of the IPv4 static routing protocol to 10.
<HUAWEI> system-view
[HUAWEI] ip route-static default-preference 10
And the internal preference cannot be modified manually. It is worth noting that the default values of the internal and external preferences of IS-IS and BGP are different.
For example, the default external preference of EBGP is 255, while the internal preference is 20.
Routing Protocol | Default External Preferences | Internal Preferences |
Direct | 0 | 0 |
OSPF | 10 | 10 |
IS-IS Level-1 | 15 | 15 |
IS-IS Level-2 | 15 | 18 |
Static | 60 | 60 |
RIP | 100 | 100 |
OSPF ASE | 150 | 150 |
OSPF NSSA | 150 | 150 |
IBGP | 255 | 200 |
EBGP | 255 | 20 |
For more details, see https://support.huawei.com/hedex/hdx.do?docid=EDOC1100007335&id=dc_feature_ip-route-overview_0005&text=Routing%25252520Protocol%25252520Preference&lang=en
Because of the existence of internal preferences, even if the routes of two different routing protocols are set to the same preference, they will not form load balancing.
For example, two routes, an OSPF route and a static route, can reach one same address, and the preferences of the two routes are set to 10, In this case, the device selects the optimal route based on the internal preferences. The internal preference of OSPF (10) is higher than that of the static route (60). Therefore, the system selects the route discovered by OSPF as the optimal route.
The default preferences of routing protocols of different vendors are different. The following table lists the preference comparison between Huawei, Cisco, and Juniper.
Routing Protocol | Huawei (External) | Cisco | Juniper |
Direct | 0 | 0 | 0 |
OSPF | 10 | 110 | 10 |
IS-IS Level-1 | 15 | 115 | Internal 15 External 160 |
IS-IS Level-2 | 15 | 115 | Internal 18 External 165 |
Static | 60 | 1 | 5 |
RIP | 100 | 120 | 100 |
OSPF ASE | 150 | 110 | 150 |
OSPF NSSA | 150 | 110 | 150 |
IBGP | 255 | 200 | 170 |
EBGP | 255 | 20 | 170 |

