3.1.2 Lab - Implement Advanced STP Modifications and Mechanisms - ILM - Student 2025
3.1.2 Lab - Implement Advanced STP Modifications and Mechanisms - ILM - Student 2025
Topology
Addressing Table
Device Interface IP Address
D1 VLAN 1 10.0.0.1/8
D2 VLAN 1 10.0.0.2/8
A1 VLAN 1 10.0.0.3/8
Objectives
Part 1: Build the Network and Configure Basic Device Settings and Interface Addressing
Part 2: Implement and Observe Various Topology Tuning Methods
Part 3: Implement and Observe Various Topology Protection Mechanisms
Background / Scenario
Although spanning tree works “out of the box: prêt à l'emploi”, the default values used in the decisions it makes may lead to logical topologies
that, although loop-free, do not align to what you need for your network. In addition, spanning tree “out of the box” is vulnerable to several
different scenarios where the root bridge status could be taken over, or a loop could be introduced in the network. In this lab you will configure
and observe various ways of bending the logical spanning tree topology to meet your requirements, as well as the different topology protection
mechanism that are available. The terms "switch" and "bridge" will be used interchangeably throughout the lab.
Note: This lab is an exercise in deploying and verifying various STP mechanisms and does not reflect networking best practices.
Part 1: Build the Network and Configure Basic Device Settings and Interface Addressing
Step 1: Cable the network as shown in the topology.
Step 2: Configure basic settings for each switch.
a.
Open configuration window
© 2020 - 2024 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 1 of 10 www.netacad.com
Lab - Implement Advanced STP Modifications and Mechanisms
b. After you have configured both D1 and D2, go to A1 and issue show spanning-tree root. In this output you will see the root bridges
differentiated.
Open configuration window
c.
A1# show spanning-tree root
Root Hello Max Fwd
Vlan Root ID Cost Time Age Dly Root Port
---------------- -------------------- --------- ----- --- --- ------------
VLAN0001 28673 d8b1.9028.af80 19 2 20 15 Fa0/1
VLAN0002 24578 d8b1.905d.c300 19 2 20 15 Fa0/3
From the above output, you can see that the root port for VLAN 1 is F0/1 and the root port for VLAN 2 is F0/3.
Close configuration window
Step 2: Adjust port cost values to impact root and designated port selection.
a. On A1, issue the commands show spanning-tree vlan 1 and show spanning-tree blockedports
A1# show spanning-tree vlan 1
VLAN0001
Spanning tree enabled protocol rstp
Root ID Priority 28673
Address d8b1.9028.af80
Cost 19
Port 1 (FastEthernet0/1)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
© 2020 - 2024 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 2 of 10 www.netacad.com
Lab - Implement Advanced STP Modifications and Mechanisms
As you can see, VLAN 1 has its Root Port on F0/1. F0/2, F0/3, and F0/4 are Alternate Blocking Ports.
To manipulate which port becomes the Root Port on non-root bridges, change the port cost or port priority value. Remember that this
change could have an impact on downstream switches as well.
b. On A1, shutdown interfaces F0/1 and F0/2, assign a new port cost to F0/2, and then issue no shutdown to the ports.
A1(config)# interface range f0/1-2
A1(config-if-range)# shutdown
A1(config)# interface f0/2
A1(config-if)# spanning-tree cost 12
A1(config)# interface range f0/1-2
A1(config-if-range)# no shutdown
c. Now verify that this impacts root port selection on A1 using the show spanning-tree vlan 1 and show spanning-tree blockedports
A1# show spanning-tree vlan 1
VLAN0001
Spanning tree enabled protocol rstp
Root ID Priority 28673
Address d8b1.9028.af80
Cost 12
Port 2 (FastEthernet0/2)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)
Address f078.1647.4580
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300 sec
From the output you can see that the root port selected by A1 for VLAN 1 is now interface F0/2, and the port (and root) cost is now
12. There is another impact to the cost being set as it has been. Issue show spanning-tree root on A1.
A1# show spanning-tree root
Root Hello Max Fwd
Vlan Root ID Cost Time Age Dly Root Port
---------------- -------------------- --------- ----- --- --- ------------
VLAN0001 28673 d8b1.9028.af80 12 2 20 15 Fa0/2
VLAN0002 24578 d8b1.905d.c300 16 2 20 15 Fa0/2
Notice that the root port for VLAN 2 is now F0/2, instead of F0/3. Why? Because the total path cost to D2 via F0/2 is now 16, which
is less than the cost of the direct link to D2 via F0/3 or F0/4.
© 2020 - 2024 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 3 of 10 www.netacad.com
Lab - Implement Advanced STP Modifications and Mechanisms
d. Adjust the cost value of interface F0/2 on A1 to 18. This will make the VLAN 2 root port F0/3 again.
A1(config)# interface range f0/1-2
A1(config-if-range)# shutdown
A1(config)# interface f0/2
A1(config-if)# spanning-tree cost 18
A1(config)# interface range f0/1-2
A1(config-if-range)# no shutdown
A1# show spanning-tree root
Root Hello Max Fwd
Vlan Root ID Cost Time Age Dly Root Port
---------------- -------------------- --------- ----- --- --- ------------
VLAN0001 28673 d8b1.9028.af80 18 2 20 15 Fa0/2
VLAN0002 24578 d8b1.905d.c300 19 2 20 15 Fa0/3
Open configuration window
As expected with two equal-cost paths to the root bridge, the lower port ID was selected as the root port.
Close configuration window
b. Modify the port priority of D2 interface F0/6 so that it becomes the preferred port.
Open configuration window
c. On A1, issue show spanning-tree vlan 2 and you will see that F0/4 is now the selected root port. This selection is based on the lower
priority value of D2 interface F0/6. Notice that the lower priority value does not appear in any A1 output.
Open configuration window
© 2020 - 2024 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 4 of 10 www.netacad.com
Lab - Implement Advanced STP Modifications and Mechanisms
A1(config-if)# shutdown
Dec 24 17:32:59.873: RSTP(1): transmitting a proposal on Fa0/23
Dec 24 17:33:03.807: %LINK-5-CHANGED: Interface FastEthernet0/23, changed state to
administratively down
A1#un a
A1# undebug all
What you see here is the switch trying to go through the Proposal/Agreement process on F0/23. But there is no point in this because
the device connected to F0/23 is an endpoint and does not understand Spanning Tree. This adds the potential of a 30-second delay
before the host can send data, such as a DHCP request to the network.
c. On A1, issue debug spanning-tree events, then configure interface F0/23 with the spanning-tree portfast followed by the no shutdown
. This designates F0/23 as an interface that will never be connected to another switch, and therefore; it will never cause a loop in the
topology, and subsequently allow that interface to go into forwarding mode immediately. Observe the output.
A1# debug spanning-tree events
A1# conf t
A1(config)# interface f0/23
A1(config-if)# spanning-tree portfast
%Warning: portfast should only be enabled on ports connected to a single
host. Connecting hubs, concentrators, switches, bridges, etc... to this
interface when portfast is enabled, can cause temporary bridging loops.
Use with CAUTION
%Portfast has been configured on FastEthernet0/23 but will only
have effect when the interface is in a non-trunking mode.
A1(config-if)# no shutdown
Dec 24 17:39:40.941: RSTP(1): initializing port Fa0/23
Dec 24 17:39:40.941: RSTP(1): Fa0/23 is now designated
Dec 24 17:39:41.318: %LINK-3-UPDOWN: Interface FastEthernet0/23, changed state to up
From the output you can see that RSTP sees F0/23 as designated, and never sends a proposal on the interface, because of the
portfast setting.
There are two other ways to configure an interface as a portfast port; using the switchport host interface configuration and using the
spanning-tree portfast default global configuration.
• switchport host not only enables portfast, but also statically sets the interface mode to access and disables aggregation
protocols.
© 2020 - 2024 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 5 of 10 www.netacad.com
Lab - Implement Advanced STP Modifications and Mechanisms
• The spanning-tree portfast default sets the default state of interfaces that are configured as access ports with portfast
enabled. All you must do is configure the interface with switchport mode access and portfast is engaged on that interface.
Verifying that a port is in portfast mode can be done by looking at the running-configuration for that port or by examining spanning-
tree details for the port. For example, use the show spanning-tree interface interface-id to verify that the interface is in Edge mode,
as shown below:
A1# show spanning-tree interface f0/23
Vlan Role Sts Cost Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------
VLAN0001 Desg FWD 100 128.23 P2p Edge
b. Go to A1 and verify what is the root port for VLAN0002. It should be interface F0/4 because of the change in port priority we configured
earlier on D2.
Open configuration window
d. To verify that root guard is working, try to have A1 take over as root bridge for VLAN0002. Issue the command spanning-tree vlan 2
priority 16384.
Open configuration window
© 2020 - 2024 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 6 of 10 www.netacad.com
Lab - Implement Advanced STP Modifications and Mechanisms
Address f078.1647.4580
Cost 23
Port 1 (GigabitEthernet1/0/1)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 24578 (priority 24576 sys-id-ext 2)
Address d8b1.905d.c300
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300 sec
Interface Role Sts Cost Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------
Gi1/0/1 Root FWD 4 128.1 P2p
Gi1/0/5 Desg BKN*19 128.5 P2p *ROOT_Inc
Gi1/0/6 Desg BKN*19 64.6 P2p *ROOT_Inc
This output has two indicators of the issue. First BKN* is short for "BROKEN", and *ROOT_Inc represents the Root Inconsistent
message. A list of all STP inconsistent ports including the reason for their inconsistency can also be requested with the command
show spanning-tree inconsistentports.
D2# show spanning-tree inconsistentports
Name Interface Inconsistency
-------------------- ------------------------------ ------------------
VLAN0002 GigabitEthernet1/0/5 Root Inconsistent
VLAN0002 GigabitEthernet1/0/6 Root Inconsistent
Number of inconsistent ports (segments) in the system : 2
f. To return things to normal, issue the command no spanning-tree vlan 2 priority 16384 on A1 and then remove root guard on interfaces
F0/5 and F0/6 of D2 with the command no spanning-tree guard root.
Close configuration window
© 2020 - 2024 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 7 of 10 www.netacad.com
Lab - Implement Advanced STP Modifications and Mechanisms
b. On A1 interface F0/1, issue the spanning-tree bpduguard enable. As you can see, the interface is almost immediately err-disabled. Issue
the shutdown , remove BPDU Guard with the no spanning-tree bpduguard enable command, and issue the no shutdown on interface
F0/1 to bring it back up. Verify the trunk is operational with the show interface trunk
A1(config)# interface f0/1
A1(config-if)# spanning-tree bpduguard enable
Jan 2 15:19:11.899: %SPANTREE-2-BLOCK_BPDUGUARD: Received BPDU on port Fa0/1 with BPDU Guard enabled. Disabling
port.
Jan 2 15:19:11.899: %PM-4-ERR_DISABLE: bpduguard error detected on Fa0/1, putting Fa0/1 in err-disable state
A1(config-if)# shutdown
Jan 2 15:19:22.955: %LINK-5-CHANGED: Interface FastEthernet0/1, changed state to administratively down
A1(config-if)# no spanning-tree bpduguard enable
A1(config-if)# no shutdown
Jan 2 15:19:39.950: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to up
A1# show interface trunk
Port Mode Encapsulation Status Native vlan
Fa0/1 on 802.1q trunking 1
Fa0/2 on 802.1q trunking 1
Fa0/3 on 802.1q trunking 1
Fa0/4 on 802.1q trunking 1
Port Vlans allowed on trunk
Fa0/1 1-4094
Fa0/2 1-4094
Fa0/3 1-4094
Fa0/4 1-4094
Port Vlans allowed and active in management domain
Fa0/1 1-2
Fa0/2 1-2
Fa0/3 1-2
Fa0/4 1-2
Port Vlans in spanning tree forwarding state and not pruned
Fa0/1 none
Fa0/2 1
Fa0/3 none
Fa0/4 2
b. Configure the interface with BPDU filter using the spanning-tree bpdufilter enable
A1(config)# interface f0/23
A1(config-if)# spanning-tree bpdufilter enable
c. Verify BPDUs are no longer being sent. Issue show spanning-tree interface f0/23 detail | i BPDU several times and you should see that
the BPDU count is not increasing.
© 2020 - 2024 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 8 of 10 www.netacad.com
Lab - Implement Advanced STP Modifications and Mechanisms
c. On D1, configure the port connecting to F0/1 for bpdufilter; in this topology it is interface F0/5.
D1(config)# interface F0/5
D1(config-if)# spanning-tree bpdufilter enable
Close configuration window
d. On A1, you should receive a SYSLOG message stating that Loop Guard has blocked port F0/1. Issue show spanning-tree vlan 2 and
you will see that F0/1 is broken. Issue show spanning-tree inconsistentports and you will see that F0/1 is loop-inconsistent.
© 2020 - 2024 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 9 of 10 www.netacad.com
Lab - Implement Advanced STP Modifications and Mechanisms
A1#
Jan 2 16:23:56.915: %SPANTREE-2-LOOPGUARD_BLOCK: Loop guard blocking port FastEthernet0/1 on VLAN0002.
f. On A1, you should see a SYSLOG message indicating Loop Guard has removed the block on interface F0/1. Remove the loop guard
configuration.
Open configuration window
A1#
Jan 2 16:28:05.075: %SPANTREE-2-LOOPGUARD_UNBLOCK: Loop guard unblocking port FastEthernet0/1 on VLAN0001.
© 2020 - 2024 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 10 of 10 www.netacad.com