< Home

stp port priority

Function

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.

Format

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

Parameters

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.
  • 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 port 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

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

Default Level

2: Configuration level

Usage Guidelines

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.

Example

# Set the priority of GE0/0/1 to 16 in the spanning tree instance 2 when MSTP is running.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] stp instance 2 port priority 16
# Set the priority of GE 0/0/1 in VLAN 10 to 32 when VBST is running.
<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] stp vlan 10 port priority 32
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >