Setting the Preference for Equal-cost OSPF Routes
Context
After OSPF calculates equal-cost routes, you can run the nexthop command to select the route with the highest preference from the equal-cost routes as the next hop. A smaller value of weight indicates a higher route preference. The default weight is 255. If OSPF discovers equal-cost routes and the number of equal-cost routes is less than or equal to that specified in the maximum load-balancing number command, OSPF performs load balancing among these equal-cost routes.
Procedure
- Run system-view
The system view is displayed.
- Run ospf [ process-id ]
The OSPF process view is displayed.
- Run nexthop ip-address weight value
The preference is set for an equal-cost route.
- The parameter ip-address specifies the next-hop address of the equal-cost route.
- The parameter value specifies the weight of the next hop. The default value is 255. A smaller value of weight indicates a higher route preference.
- Run commit
The configuration is committed.