Configuring Equal-Cost Routes

You can set the number of OSPF equal-cost routes and route preference to implement load balancing and adjust route selection.

Context

If the destinations and costs of the multiple routes discovered by one routing protocol are the same, load balancing can be implemented among the routes.

As shown in Figure 1, three routes between Device A and Device B that run OSPF have the same costs. The three routes are equal-cost routes for load balancing.

Figure 1 Networking diagram of equal-cost routes

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run ospf [ process-id ]

    The OSPF process view is displayed.

  3. Run maximum load-balancing number

    The maximum number of equal-cost routes is set.

    If the number of equal-cost routes is greater than number specified in the maximum load-balancing command, routes are selected for load balancing based on the following criteria:

    1. Route priority: Routes with smaller priority values are selected for load balancing. For details about route priority configuration, see 4.
    2. Interface index: If routes have the same priority, those with greater interface index values are selected for load balancing.
    3. Next hop IP address: If routes have the same priority and interface index, those with larger IP addresses are selected for load balancing.

  4. (Optional) Run either of the following commands:

    • To configure a priority for an equal-cost route, run the nexthop ip-address weight value command.

      Among equal-cost OSPF routes, those with smaller priority values configured using the nexthop command are selected for load balancing.

      • ip-address specifies the next hop address of the equal-cost route.
      • value specifies the weight of the next hop.
    • To configure priorities for the routes with a TE tunnel interface or an IPv4 interface as the outbound interface for route selection if both an IGP-Shortcut-enabled TE tunnel and IP link are available, run the ecmp prefer { te-tunnel | intact } command.

  5. Run commit

    The configuration is committed.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >