< Home

stp max-hops

Function

The stp max-hops command sets the maximum hops of a spanning tree in an MST region.

The undo stp max-hops command restores the default value of the maximum hops of a spanning tree.

By default, the maximum hops in an MST region is 20.

Format

stp max-hops hop

undo stp max-hops

Parameters

Parameter Description Value
hop Specifies the maximum hops. The value ranges from 1 to 40.

Views

System view or MSTP process view

VBST does not support processes. When VBST is running, you cannot run the stp max-hops command in the MSTP process view.

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

Switching devices on a Layer 2 network running MSTP communicate with each other by exchanging MST BPDUs. An MST BPDU has a field that indicates the number of remaining hops.
  • The number of remaining hops in a BPDU sent by the root switching device equals the maximum number of hops.

  • The number of remaining hops in a BPDU sent by a non-root switching device equals the maximum number of hops minus the number of hops from the non-root switching device to the root switching device.

  • If a switching device receives a BPDU in which the number of remaining hops is 0, the switching device will discard the BPDU.

Therefore, the maximum number of hops of a spanning tree in an MST region determines the network scale. The stp max-hops command can be used to set the maximum number of hops in an MST domain so that the network scale of a spanning tree can be controlled.

Precautions

In an MST region, the maximum number of hops set on the root switching device in a CIST or an MSTI is the maximum number of hops in the CIST or MSTI.

Example

# Set the maximum hops in the MST region to 35.

<HUAWEI> system-view
[HUAWEI] stp max-hops 35
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >