nexthop weight (OSPF view)

Function

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

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

By default, the value is 255. Equal-cost routes load-balance traffic.

Format

nexthop ip-address weight value

undo nexthop ip-address

Parameters

Parameter Description Value
ip-address

Specifies the IP address of the next hop.

The value is in dotted decimal notation.

value

Specifies a priority for the next hop. The smaller the value, the higher the priority.

It is an integer ranging from 1 to 254.

Views

OSPF view

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
ospf write

Usage Guidelines

Usage Scenario

If the number of equal-cost routes on a network is greater than the value set using the maximum load-balancing command and specified equal-cost routes need to be used for load balancing, run the nexthop command to a high priority for these routes.

Example

# Set the priority of equal-cost routes in OSPF.
<HUAWEI> system-view
[~HUAWEI] ospf 1
[*HUAWEI-ospf-1] nexthop 10.0.0.3 weight 1
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >