You can set the number of OSPF equal-cost routes and route preference to implement load balancing and adjust route selection.
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.
The system view is displayed.
The OSPF process view is displayed.
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:
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.
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.
The configuration is committed.