Configuring the port priority

The priority of a port is a factor that determines whether the port can be elected as the root port of a device. If all other conditions are the same, the port with the highest priority is elected as the root port.

On a spanning tree device, a port can have different priorities and play different roles in different spanning trees. As a result, data of different VLANs can be propagated along different physical paths, implementing per-VLAN load balancing. You can set port priority values based on the actual networking requirements.

When the priority of a port changes, the system recalculates the port role and initiates a state transition.

To configure the priority of a port:

Step

Command

Remarks

1. Enter system view.

system-view

N/A

2. Enter Layer 2 Ethernet or aggregate interface view.

interface interface-type interface-number

N/A

3. Configure the port priority.

  • In STP/RSTP mode:stp port priority priority

  • In PVST mode:stp vlan vlan-id-list port priority priority

  • In MSTP mode:stp [ instance instance-list ] port priority priority

The default setting is 128 for all ports.