The stp port priority command sets the priority of a port in a spanning tree.
The undo stp port priority command restores the default priority.
By default, the priority of a port in a spanning tree is 128.
STP/RSTP/MSTP: stp [ process process-id ] [ instance instance-id ] port priority priority
VBST: stp [ vlan { vlan-id1 [ to vlan-id2 ] } &<1-10> ] port priority priority
STP/RSTP/MSTP: undo stp [ process process-id ] [ instance instance-id ] port priority
VBST: undo stp [ vlan { vlan-id1 [ to vlan-id2 ] } &<1-10> ] port priority
Parameter | Description | Value |
---|---|---|
process process-id |
Indicates the ID of an MSTP process. If process process-id is not specified, the status and statistics of an MSTP process with the ID 0 will be displayed. |
The value is an integer ranging from 1 to 31. |
instance instance-id |
Specifies the spanning tree instance. If this parameter is not specified, the statistics about the topology changes of a CIST are displayed. |
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 a port. |
The priority ranks from 0 to 240 in descending order. The value is an integer multiple of 16, such as, 0, 16, and 32. |
vlan vlan-id1 [ to vlan-id2 ] |
Specifies one or more VLANs in which the port priority is configured.
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. |
Ethernet interface view, GE interface view, XGE interface view, MultiGE interface view, 40GE interface view, 100GE interface view, Eth-Trunk interface view, port group view, 25GE interface view
Usage Scenario
When ports participate in spanning tree calculation, the PIDs of these ports on switching devices may affect the designated port election result. During spanning tree calculation, the port with the smallest PID is elected as the designated port.
A PID is the ID of a port, and consists of a 4-bit priority and a 12-bit port number.
The stp port priority command can be used to change the priority of a port. This affects the PID of the port and determines whether the port can be elected as the designated port.
Precautions
When the priority of a port changes, a spanning tree protocol recalculates the role of the port and performs status transition for the port.
The priority of a port determines the role of the port in a specified spanning tree instance and process. You can set different priorities for a port in different spanning tree instances or processes so that user traffic can be forwarded along different links and traffic load balancing can be implemented.
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.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] stp instance 2 port priority 16
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] stp vlan 10 port priority 32