< Home

stp priority

Function

The stp priority command sets the priority of the switching device in a spanning tree.

The undo stp priority command restores the default priority.

By default, the priority of the switching device in a spanning tree is 32768.

Format

STP/RSTP/MSTP: stp [ instance instance-id ] priority priority

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

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

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

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. instance-id ranges from 0 to 4094. Each process supports a maximum of 65 instances.

priority

Specifies the priority of the switching device in a spanning tree.

The smaller the value is, the higher the switch priority is.

The priority ranks from 0 to 61440. The value is an integer multiple of 4096, such as 0, 4096 and 8192. The default is 32768.

vlan vlan-id1 [ to vlan-id2 ]

Specifies one or more VLANs in which the switch priority is configured.
  • vlan-id1 specifies the start VLAN ID.
  • to vlan-id2 specifies the end VLAN ID. vlan-id2 must be greater than or equal to vlan-id1. vlan-id2 and vlan-id1 specify a VLAN range.
  • If to vlan-id2 is not specified, the switch priority is configured only for the VLAN specified by vlan-id1.

In the stp priority 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 priority command in the MSTP process view.

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

Priorities of switching devices are an important factor to calculate a spanning tree and determine the selection of the root bridge.

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

Other devices with low performance and network hierarchy are not fit to be a root bridge. Therefore, set low priorities for these devices.

On an MSTP network, each switching device can be set with a distinct priority in each spanning tree instance. On a VBST network, each switch can be set with a priority for the spanning tree in each VLAN.

Precautions

The smaller the priority value of a switching device is, the higher the possibility that the switching device is selected as the root bridge.

If a switching device has been configured as the primary or secondary root bridge, before changing the priority of the switching device, run the undo stp [ instance instance-id ] root command to disable the root bridge or secondary root bridge function.

If the stp root primary command is run to set a switching device as the primary root bridge, the priority value of the switching device is 0.

If the stp root secondary command is run to set a switching device as the secondary root bridge, the priority value of the switching device is 4096.

Enabling MSTP on a ring network immediately triggers spanning tree calculation. If basic configurations are not performed on switches and interfaces before MSTP is enabled, network flapping may occur upon changes to parameters such as device priority and interface priority.

Example

# Set the priority of the switching device in spanning tree instance 1 to 4096 when MSTP is running.

<HUAWEI> system-view
[HUAWEI] stp instance 1 priority 4096
# Set the priority of the switch in VLAN 10 to 4096 when VBST is running.
<HUAWEI> system-view
[HUAWEI] stp vlan 10 priority 4096
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >