Spanning TreeInterface Config

spanning-tree port-priority [value]

Sets the port priority value for a specific interface to influence which port becomes the root port in a Spanning Tree topology.

Syntax·Interface Config
spanning-tree port-priority [value]

When to Use This Command

  • Manually selecting a preferred root port on a non-root bridge to control traffic flow.
  • Load balancing traffic across redundant links by adjusting port priorities.
  • Ensuring a specific high-bandwidth link becomes the root port for faster convergence.
  • Preventing a slow or unreliable link from being elected as the root port.

Command Examples

Setting port priority to 64 on GigabitEthernet0/1

spanning-tree port-priority 64
Switch(config-if)# spanning-tree port-priority 64
Switch(config-if)# end
Switch# show spanning-tree interface gigabitEthernet 0/1

Vlan                Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
VLAN0001            Root FWD 4         64.1     P2p
VLAN0010            Desg FWD 4         64.1     P2p

The 'spanning-tree port-priority 64' command sets the priority to 64 for this interface. The 'show spanning-tree interface' output shows the port role (Root or Desg), state (FWD), cost, and the priority.nbr (64.1). The priority value (64) is lower than default (128), making this port more likely to be selected as root port.

Verifying port priority change on FastEthernet0/1

spanning-tree port-priority 32
Switch(config-if)# spanning-tree port-priority 32
Switch(config-if)# end
Switch# show spanning-tree vlan 1

VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    32769
             Address     0011.2233.4455
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)
             Address     0011.2233.4455
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/1            Desg FWD 19        32.1     P2p
Fa0/2            Desg FWD 19        128.2    P2p

After setting priority to 32 on Fa0/1, the 'show spanning-tree vlan 1' output shows Fa0/1 with priority 32.1 (priority 32, port number 1). The lower priority makes it more favorable, but since this bridge is root, both ports are designated. The priority influences which port becomes root on downstream switches.

Understanding the Output

The 'show spanning-tree' or 'show spanning-tree interface' command displays the spanning-tree state per VLAN. The 'Pri.Nbr' column shows the port priority (first number) and port number (second number). Lower priority values make a port more likely to be elected as the root port. In the output, 'Role' indicates the port role (Root, Desg, Altn, Back), and 'Sts' shows the state (FWD, BLK, LRN, LSN). A priority of 128 is default; values from 0 to 240 in increments of 16 are valid. If you see a port with a lower priority than others on the same switch, that port is preferred for root port selection. Watch for misconfigurations where a port with a high priority (e.g., 240) might be blocked unnecessarily.

CCNA Exam Tips

1.

CCNA exam tip: Port priority values must be multiples of 16 (0, 16, 32, ..., 240).

2.

CCNA exam tip: The default port priority is 128; lowering it makes the port more likely to become root port.

3.

CCNA exam tip: Port priority is used as a tie-breaker when path costs are equal.

4.

CCNA exam tip: Remember that port priority is configured per interface, not globally.

Common Mistakes

Mistake: Setting port priority to a non-multiple of 16 (e.g., 50) — the IOS will reject it.

Mistake: Confusing port priority with bridge priority — port priority is per interface, bridge priority is per switch.

Mistake: Forgetting to apply the command in interface configuration mode.

Related Commands

Practice for the CCNA 200-301

Test your knowledge with hundreds of CCNA practice questions covering all exam domains.

Practice CCNA Questions