< Home

nexthop (OSPF)

Function

The nexthop command sets the preference for the equal-cost routes. After OSPF calculates the equal-cost routes, the next hop is chosen from these equal-cost routes based on the value of weight. The smaller the value is, the higher the preference is.

The undo nexthop command cancels the preference of these equal-cost routes.

By default, the value of weight is 255. Equal-cost routes have no preference, and they forward packets at the same time. Load balancing is performed among them.

Format

nexthop ip-address weight value

undo nexthop ip-address

Parameters

Parameter Description Value
ip-address Indicates the IP address of next hop. It is in the decimal notation format.
value Indicates the weight of the next hop. The smaller the value is, the higher the preference of the route is. It is an integer that ranges from 1 to 254. By default, it is 255.

Views

OSPF view

Default Level

2: Configuration level

Usage Guidelines

When the number of equal-cost routes on the network is larger than the number of the routes specified in the maximum load-balancing command, set the preference of specified valid routes to high running the nexthop command if you need to specify valid routes for load balancing.

Example

# Set the preference of equal-cost routes in OSPF.

<sysname> system-view
[sysname] ospf 1
[sysname-ospf-1] nexthop 10.0.0.3 weight 1
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >