Configuring Spanning Tree Port Priority

Refer to Figure Spanning Tree Topology. All switches are configured for STP compatible using the “spanning-tree compatibility stp” Global Configuration mode command. After the topology stabilizes, Switch A is elected as Root and all ports of all switches except Ports 2 and 3 (alternate, discarding) of Switch C are in forwarding state.

Figure 1. Spanning Tree Topology for Configuring Port Priority


Switch A: VLAN 1 -10.0.0.1/255.0.0.0

Switch B: VLAN 1 – 10.0.0.2 /255.0.0.0

Switch C: VLAN 1 – 10.0.0.3/255.0.0.0

When a loop occurs in a network topology, spanning tree may use the value of port-priority of the ports to decide the port that must be put in the forwarding state.

Port priority is used to determine the topology only if the loop in the network cannot be resolved using the Bridge IDs or path-cost.

If higher priority (lower numerical value) is assigned to a port, it goes to forwarding first and when lower priority (higher numerical value) is assigned to a port, it goes to forwarding last. If all ports have same priority values, spanning tree puts the lowest numbered interface to forwarding and blocks all other interfaces

Execute the following commands in the Switch C.

Type the following:

  • Enter the Global Configuration Mode in ISS1.
iS5comm# configure terminal
  • Specify the interface for which the path cost is to be configured
iS5comm(config)# interface gigabitethernet 0/1

Valid interfaces include physical interfaces and port-channel logical interfaces (port-channel port-channel-number).

  • Configure the port priority for spanning tree.
iS5comm(config-if) # spanning-tree port-priority 32

For priority, the range is 0 to 240 in increments of 16. The default is 128. The lower the number, the higher the priority.

Valid priority values are 0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, and 240. All other values are rejected.

Note:

Observation after configuring the Port Priority for Port 3 in Switch A: Ports 1, 2 of Switch B are the Alternate Ports and Port 3 is the root port.

  • Return to the Privileged EXEC mode.
iS5comm(config)#end
  • View the spanning tree properties by executing the following show command.
iS5comm# show spanning-tree

In Switch A

Root Id         Priority   32768
Address 00:01:02:03:04:01
 Cost       200000
 Port       0 [0]
Max age 20 sec 0 cs, forward delay 15 sec 0 cs
 Hello Time 2 sec 0 cs

MST00
Spanning Tree Protocol Enabled.
MST000 is executing the mstp compatible Multiple Spanning Tree Protocol
Bridge Id   Priority  32768
 Address  00:01:02:03:04:01
 Max age is 20 sec 0 cs, forward delay is 15 sec 0 cs
Hello Time is 2 sec 0 cs
Name    Role        State        Cost     Prio   Type
----    ----        -----        ----     ----   ------
Gi0/1   Designated  Forwarding   200000   128    SharedLan
Gi0/2   Designated  Forwarding   200000   128    SharedLan
Gi0/3   Designated  Forwarding   200000   32     SharedLan

In Switch B

Root Id         Priority 32768
Address    00:03:02:03:04:01
 Cost       200000
 Port 1 [Gi0/1]
Max age 20 sec 0 cs, forward delay 15 sec 0 cs
 Hello Time 2 sec 0 cs

MST00
Spanning Tree Protocol Enabled.
MST000 is executing the mstp compatible Multiple Spanning Tree Protocol
Bridge Id   Priority  32768
 Address  00:02:02:03:04:01
 Max age is 20 sec 0 cs, forward delay is 15 sec 0 cs
Hello Time is 2 sec 0 cs
Name    Role        State        Cost     Prio   Type
----    ----        -----        ----     ----   ------
Gi0/1   Root        Forwarding   200000   128    SharedLan
Gi0/2   Designated  Forwarding   200000   128    SharedLan

In Switch C

Root Id         Priority 32768
Address    00:03:02:03:04:01
 Cost       2000
 Port 2 [Gi0/2]
Max age 20 sec 0 cs, forward delay 15 sec 0 cs
 Hello Time 2 sec 0 cs

MST00
Spanning Tree Protocol Enabled.
MST000 is executing the mstp compatible Multiple Spanning Tree Protocol
Bridge Id   Priority 4096
 Address  00:03:02:03:04:01
 Max age is 20 sec 0 cs, forward delay is 15 sec 0 cs
Hello Time is 2 sec 0 cs
Name    Role        State        Cost     Prio   Type
----    ----        -----        ----     ----   ------
Gi0/1   Alternate   Forwarding   200000   128    SharedLan
Gi0/2   Alternate   Forwarding   200000   128    SharedLan
Gi0/3   Root        Forwarding   200000   128	    SharedLan
  • Execute the no spanning-tree port-priority Interface configuration command to set the Spanning Tree Port Priority to its default value.
iS5comm(config-if)#no spanning-tree port-priority