< Home

stp root

Function

The stp root command configures the switch as a root bridge or secondary root bridge of a spanning tree.

The undo stp root command cancels the configuration.

By default, the switch does not function as the root bridge or secondary root bridge of a spanning tree.

Format

STP/RSTP/MSTP: stp [ instance instance-id ] root { primary | secondary }

STP/RSTP/MSTP: undo stp [ instance instance-id ] root

VBST: stp [ vlan { vlan-id1 [ to vlan-id2 ] } &<1-10> ] root { primary | secondary }

VBST: undo stp [ vlan { vlan-id1 [ to vlan-id2 ] } &<1-10> ] root

Parameters

Parameter Description Value
instance instance-id Specifies the ID of a spanning tree instance.

If the parameter instance instance-id is not specified, the configuration takes effect on a CIST instance.

The value is an integer ranging from 0 to 4094. Value 0 refers to CIST.
NOTE:

instance-id ranges from 0 to 4094. Each process supports a maximum of 65 instances.

primary Indicates that the switch functions as the root bridge of a spanning tree. -
secondary Indicates that the switch functions as the secondary root bridge of a spanning tree. -
vlan vlan-id1 [ to vlan-id2 ]
Specifies the VLAN to which the switch used as the root bridge or secondary root bridge belongs.
  • vlan-id1 specifies the first VLAN to which the switch used as the root bridge or secondary root bridge belongs.
  • to vlan-id2 specifies the last VLAN to which the switch used as the root bridge or secondary root bridge belongs. vlan-id2 must be greater than or equal to vlan-id1. vlan-id2 and vlan-id1 determine a VLAN range.
  • If to vlan-id2 is not specified, the VLAN specified by vlan-id1 is used.

In the stp root secondary command, you can specify a maximum of 10 VLAN ranges.

NOTE:

VLANs can be specified only when VBST is running.

The value is an integer that ranges from 1 to 4094.

Views

System view or MSTP process view

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

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

On a spanning tree protocol network, each spanning tree has only one root bridge, which is responsible for sending BPDUs. Owning to the importance of the root bridge, the switch with high performance and network hierarchy is generally chosen as a root bridge. The priority of such a device, however, may be not that high. Therefore, setting a high priority for the switch is necessary so that the switch can function as a root bridge.

To ensure nonstop traffic transmission, run the stp root command to configure the switch as the secondary root bridge. When the root bridge is faulty or is powered off, the secondary root bridge becomes the root bridge during spanning tree calculation.

After the stp root primary command is run to set the switch to be the primary root bridge, the priority value of the switch is 0 in the spanning tree and the priority cannot be modified.

The secondary root bridge specified using the stp root secondary command has the priority value of 4096 and the priority cannot be modified.

Precautions

A spanning tree has only one root bridge.

A switch in a spanning tree cannot function both as the primary root bridge and as the secondary root bridge.

If multiple secondary root bridges are set in a spanning tree, the one with the smallest MAC address functions as the secondary root bridge of the spanning tree.

When the device connects to a non-Huawei device, you are advised to run the stp vlan { vlan-id1 [ to vlan-id2 ] } &<1-10> priority priority command to set the device priority to ensure that the root bridge is selected correctly.

Example

# Configure the switch as the root bridge of spanning tree instance 1 when MSTP is running.

<HUAWEI> system-view
[HUAWEI] stp instance 1 root primary
# Configure the switch as the root bridge in VLAN 10 when VBST is running.
<HUAWEI> system-view
[HUAWEI] stp vlan 10 root primary

# Configure the switch as the secondary root bridge of spanning tree instance 4 when MSTP is running.

<HUAWEI> system-view
[HUAWEI] stp instance 4 root secondary
# Configure the switch as the secondary root bridge in VLAN 10 when VBST is running.
<HUAWEI> system-view
[HUAWEI] stp vlan 10 root secondary
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >