Ccnpv7.1 Switch Lab4-1 STP Student
Ccnpv7.1 Switch Lab4-1 STP Student
Ccnpv7.1 Switch Lab4-1 STP Student
1 SWITCH
Objectives
Observe default Spanning Tree behavior
Implement Rapid Spanning Tree
Implement STP tool kit components
Background
The potential effect of a loop in the layer 2 network is significant. Layer 2 loops could impact connected hosts
as well as the network equipment. Layer 2 loops can be prevented by following good design practices and
careful implementation of the Spanning Tree Protocol. In this lab you will observe and manipulate the
operation of spanning tree protocols to help secure the layer 2 network from loops and topology disruptions.
The terms "switch" and "bridge" will be used interchangeably throughout the lab.
Note: This lab uses Cisco Catalyst 3560 and 2960 switches running Cisco IOS 15.0(2)SE6 IP Services and
LAN Base images, respectively. The 3560 and 2960 switches are configured with the SDM templates “dual-
ipv4-and-ipv6 routing” and “lanbase-routing”, respectively. Depending on the switch model and Cisco IOS
Software version, the commands available and output produced might vary from what is shown in this lab.
Catalyst 3650 switches (running any Cisco IOS XE release) and Catalyst 2960-Plus switches (running any
comparable Cisco IOS image) can be used in place of the Catalyst 3560 switches and the Catalyst 2960
switches.
Required Resources
2 Cisco 2960 with the Cisco IOS Release 15.0(2)SE6 C2960-LANBASEK9-M or comparable
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 1 of 45
CCNPv7.1 SWITCH: Lab 4-1 – Implement Spanning Tree Protocols
2 Cisco 3560v2 with the Cisco IOS Release 15.0(2)SE6 C3560-IPSERVICESK9-M or comparable
Computer with terminal emulation software
Ethernet and console cables
1 Windows 7 PC with Wireshark, TCPDump, or another comparable packet capture utility installed
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 2 of 45
CCNPv7.1 SWITCH: Lab 4-1 – Implement Spanning Tree Protocols
Next, enable interfaces F0/7 through F0/12 as 802.1Q trunk ports. Perform this step on all four switches. An
example from DLS1:
DLS1# conf t
Enter configuration commands, one per line. End with CNTL/Z.
DLS1(config)# int ran f0/7-12
DLS1(config-if-range)# switchport trunk encap dot1q
DLS1(config-if-range)# switchport trunk native vlan 666
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 3 of 45
CCNPv7.1 SWITCH: Lab 4-1 – Implement Spanning Tree Protocols
Finally, configure all four switches as VTP version 3 servers in domain SWLAB with no password. An
example from DLS1:
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 4 of 45
CCNPv7.1 SWITCH: Lab 4-1 – Implement Spanning Tree Protocols
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 5 of 45
CCNPv7.1 SWITCH: Lab 4-1 – Implement Spanning Tree Protocols
DLS1(config)# vlan 99
DLS1(config-vlan)# name MANAGEMENT
DLS1(config-vlan)# vlan 100
DLS1(config-vlan)# name SERVERS
DLS1(config-vlan)# vlan 110
DLS1(config-vlan)# name GUEST
DLS1(config-vlan)# vlan 120
DLS1(config-vlan)# name OFFICE
DLS1(config-vlan)# vlan 999
DLS1(config-vlan)# name PARKING_LOT
DLS1(config-vlan)# state suspend
DLS1(config-vlan)# vlan 666
DLS1(config-vlan)# name NATIVE_DO_NOT_USE
DLS1(config-vlan)# exit
DLS1(config)#
Feature VLAN:
--------------
VTP Operating Mode : Server
Number of existing VLANs : 11
Number of existing extended VLANs : 0
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 6 of 45
CCNPv7.1 SWITCH: Lab 4-1 – Implement Spanning Tree Protocols
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 7 of 45
CCNPv7.1 SWITCH: Lab 4-1 – Implement Spanning Tree Protocols
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 8 of 45
CCNPv7.1 SWITCH: Lab 4-1 – Implement Spanning Tree Protocols
Compare the output of the show span command on all of the switches; why did the current root get elected?
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 9 of 45
CCNPv7.1 SWITCH: Lab 4-1 – Implement Spanning Tree Protocols
Port 11 (FastEthernet0/9)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
The current root bridge was elected based on the lowest Bridge ID (consisting of the Priority, extended
system ID equal to the VLAN ID, and base MAC address values). In the output above, the root’s MAC is
5017.ff84.0a80; the local bridge MAC is e840.406f.7280.
With the priority and extended system IDs being identical, the root bridge's MAC is numerically smaller than
the local bridge’s MAC. The end result is that in a completely un-configured network, one single switch will be
elected as the root bridge. The resulting choice of switch may or may not be desirable.
There are two basic ways to manipulate the configuration to control the location of the root bridge.
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 10 of 45
CCNPv7.1 SWITCH: Lab 4-1 – Implement Spanning Tree Protocols
The spanning-tree vlan vlan-id priority value command can be used to manually set a
priority value
The spanning-tree vlan vlan-id root { primary | secondary } command can be
used to automatically set a priority value.
The difference between the two is the priority command will set a specific number (multiple of 4096) as
the priority, while the root primary command will set the local bridge's priority to 24,576 (if the local bridge
MAC is lower than the current root bridge's MAC) or 4096 lower than the current root's priority (if the local
bridge MAC is higher than the current root bridge's MAC).
The logic behind this operation is straight-forward. The root primary command tries to lower the priority
only as much as is needed to win the root election, while leaving priorities between 24576 and the default
32768 for use by secondary bridges. The command always takes the entire Bridge ID into account when
computing the resulting priority value.
The spanning-tree vlan vlan-id root secondary command will statically set the local bridge’s
priority to 28,672. In an otherwise unconfigured network where all switch priorities default to 32,768, the root
primary command will set the priority on the switch to 24,576 (two “steps” lower than the default priority)
while the root secondary command will set the priority on the secondary root to the 28,672 (one “step”
lower than the default priority).
Modify DLS1 and DLS2 so that DLS 1 is elected the primary root bridge for VLANs 99 and 100 and DLS2 is
elected the primary root bridge for VLAN 110 and 120. DLS1 should be elected as the secondary root bridge
for VLAN 110 and 120, and DLS2 should be elected as the secondary root bridge for VLANs 99, and 100.
You will need to make configuration changes on both DLS1 and DLS2.
An example from DLS1:
DLS1# conf t
Enter configuration commands, one per line. End with CNTL/Z.
DLS1(config)# spanning-tree vlan 99,100 root primary
DLS1(config)# spanning-tree vlan 110,120 root secondary
DLS1(config)# exit
DLS1#
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 11 of 45
CCNPv7.1 SWITCH: Lab 4-1 – Implement Spanning Tree Protocols
The show spanning-tree bridge command also provides detailed information about the current
configuration of the local bridge:
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 12 of 45
CCNPv7.1 SWITCH: Lab 4-1 – Implement Spanning Tree Protocols
In the case where there are multiple equal cost paths to the root bridge, additional attributes must be
evaluated. In our case, the lower interface number (for example, F0/11) is chosen as the Root Port, and the
higher interface number (for example, F0/12) is put into a spanning tree Blocking state.
You can see which ports are blocked with the show spanning-tree vlan-id command or the show
spanning-tree blockedports command. For now examine VLAN 110 on DLS1.
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 13 of 45
CCNPv7.1 SWITCH: Lab 4-1 – Implement Spanning Tree Protocols
VLAN0110
Spanning tree enabled protocol ieee
Root ID Priority 24686
Address e840.406f.6e00
Cost 19
Port 13 (FastEthernet0/11)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 14 of 45
CCNPv7.1 SWITCH: Lab 4-1 – Implement Spanning Tree Protocols
As you can see, VLAN 110 has its Root Port on Fa0/11 and Fa0/12 is an Alternate Blocking Port. Note that
despite the switch not yet running Rapid STP, it recognizes the port roles as known by RSTP.
It is possible to manipulate which port becomes the Root Port on non-root bridges by manipulating the port
cost value, or by changing the port priority value. Remember that this change could have an impact on
downstream switches as well. For this example, we will examine both options.
Note: The changes you are about to implement are considered topology changes and could have a significant
impact on the overall structure of the spanning tree in your switch network. Do not make these changes in a
production network without careful planning and prior coordination.
The first change you will make will influence the Root Port election based on a change to the port cost. We
will further examine the impact of the changes to downstream switches.
To do this, issue the shutdown command on interfaces Fa0/9 and Fa0/10 on DLS1 and DLS2. Example from
DLS1:
DLS1# conf t
Enter configuration commands, one per line. End with CNTL/Z.
DLS1(config)# int ran f0/9-10
DLS1(config-if-range)# shut
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 15 of 45
CCNPv7.1 SWITCH: Lab 4-1 – Implement Spanning Tree Protocols
DLS1(config-if-range)# exit
DLS1(config)#
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 16 of 45
CCNPv7.1 SWITCH: Lab 4-1 – Implement Spanning Tree Protocols
The election of the Root Port is based on the lowest total path cost to the root bridge. The root path cost is a
sum of all of the Root Port costs between the local bridge and the root bridge. If the total path cost to the root
bridge is the same over multiple ports, then the port towards the neighbor switch that has the lowest Bridge ID
is chosen as the Root Port.
If the local bridge has multiple connections to a neighbor bridge that is in the lowest-cost path, BDPUs sent
from that neighbor are examined and the BPDU containing the lowest sending Port-ID is chosen as the Root
Port. In this case the term "sending" refers to the switch and its port that forwarded the BPDU.
Notice in the output above that the root bridge for VLAN110 is reachable from ALS1 via Fa0/7 with a total root
path cost of 38 (19 for the Fa0/7 trunk between ALS1 and DLS1, and 19 for the trunk between DLS1 and
DLS2).
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 17 of 45
CCNPv7.1 SWITCH: Lab 4-1 – Implement Spanning Tree Protocols
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 18 of 45
CCNPv7.1 SWITCH: Lab 4-1 – Implement Spanning Tree Protocols
ALS1's Root Port changed to F0/11, and the path cost to the Root Bridge changed to 31 (19 + 12).
The change you just made on ALS2 did not impact the Root Port from its perspective; it is still Fa0/7.
Next you will use port priority to modify which port is selected as the Root Port. For this exercise, we will focus
on VLAN 100.
On DLS1, use show span vlan 100 to see what the priorities are (default to 128)
VLAN0100
Spanning tree enabled protocol ieee
Root ID Priority 24676
Address e840.406f.7280
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 19 of 45
CCNPv7.1 SWITCH: Lab 4-1 – Implement Spanning Tree Protocols
In the output above, focus on interface Fa0/7. Notice that its Port ID is made up of two values, labeled as Prio
(Priority) and Nbr (Number): The priority number (128) and the port number (9).
The port number is not necessarily equal to the interface ID. On the 3560s used for creating this lab, port
numbers 1 and 2 are assigned to G0/1 and G0/2 respectively, whereas on the 2960s G0/1 and G0/2 area
assigned the port numbers 25 and 26. A switch may use any port number for STP purposed as long as they
are unique for each port on the switch.
The port priority can be any value between 0 and 240, in increments of 16 (older switches may allow setting
the priority in different increments).
Next, examine ALS1 to find the root port for VLAN 100:
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 20 of 45
CCNPv7.1 SWITCH: Lab 4-1 – Implement Spanning Tree Protocols
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 21 of 45
CCNPv7.1 SWITCH: Lab 4-1 – Implement Spanning Tree Protocols
VLAN0100
Spanning tree enabled protocol ieee
Root ID Priority 24676
Address e840.406f.7280
Cost 19
Port 8 (FastEthernet0/8)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Notice that the priority value at ALS1 doesn't change, but the Root Port did, based on DLS1's advertised port
priorities.
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 22 of 45
CCNPv7.1 SWITCH: Lab 4-1 – Implement Spanning Tree Protocols
VLAN0110
Spanning tree enabled protocol ieee
Root ID Priority 24686
Address e840.406f.6e00
Cost 19
Port 14 (FastEthernet0/12)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 23 of 45
CCNPv7.1 SWITCH: Lab 4-1 – Implement Spanning Tree Protocols
As you can see from the timestamps, it took a full 30 seconds for PVST to settle on Fa0/12 as the root port
and move to the Forwarding state on the Designated Ports. When Fa0/11 is reactivated:
DLS1(config-if)#no shut
*Mar 1 02:12:28.902: set portid: VLAN0110 Fa0/11: new port id 800D
*Mar 1 02:12:28.902: STP: VLAN0110 Fa0/11 -> listening
*Mar 1 02:12:29.900: STP: VLAN0110 new root port Fa0/11, cost 19
*Mar 1 02:12:29.900: STP: VLAN0110 sent Topology Change Notice on Fa0/11
*Mar 1 02:12:29.900: STP [110]: Generating TC trap for port FastEthernet0/12
*Mar 1 02:12:29.900: STP: VLAN0110 Fa0/12 -> blocking
*Mar 1 02:12:43.909: STP: VLAN0110 Fa0/11 -> learning
*Mar 1 02:12:58.916: STP[110]: Generating TC trap for port FastEthernet0/11
*Mar 1 02:12:58.916: STP: VLAN0110 sent Topology Change Notice on Fa0/11
*Mar 1 02:12:58.916: STP: VLAN0110 Fa0/11 -> forwarding
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 24 of 45
CCNPv7.1 SWITCH: Lab 4-1 – Implement Spanning Tree Protocols
The issue with PVST is that its convergence is quite slow. The time for the transition between port states is
called forward-delay and by default, it is 15 seconds. In addition, the time until a BPDU stored on a port
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 25 of 45
CCNPv7.1 SWITCH: Lab 4-1 – Implement Spanning Tree Protocols
expires is called max-age and is 20 seconds by default. Depending on the nature of a topological change,
STP requires between 30 and 50 seconds to converge on a new loop-free topology.
Rapid Spanning Tree significantly reduces the time it takes to go from the Discarding (PVST: Blocking) to the
Forwarding state.
Configure Rapid Spanning Tree Protocol on DLS1. Use the clear spanning-tree detected-
protocols privileged EXEC command to flush any stored PVST information.
DLS1# conf t
DLS1(config)# spanning-tree mode rapid-pvst
DLS1(config)# end
DLS1#clear spanning-tree detected-protocols
DLS1#
Then verify the protocol. Use the show span vlan 110 command:
VLAN0110
Spanning tree enabled protocol rstp
Root ID Priority 24686
Address e840.406f.6e00
Cost 19
Port 13 (FastEthernet0/11)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 26 of 45
CCNPv7.1 SWITCH: Lab 4-1 – Implement Spanning Tree Protocols
Take note of the Type field in the output. All of the other switches are still running PVST, which is noted here
by the entry Peer(STP).
Configure the rest of the switches to use Rapid Spanning Tree Protocol, then verify the protocol is running. An
example from DLS2:
DLS2# show span vlan 99
VLAN0099
Spanning tree enabled protocol rstp
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 27 of 45
CCNPv7.1 SWITCH: Lab 4-1 – Implement Spanning Tree Protocols
To examine the impact of Rapid Spanning Tree on convergence time, use the debug spanning-tree
events command on DLS1 and watch how long re-convergence takes when interface Fa0/11 on DLS1 is
shut down (Fa0/11 is DLS1’s Root Port for VLAN 110). The output below has been manually filtered for VLAN
110 related messages only:
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 28 of 45
CCNPv7.1 SWITCH: Lab 4-1 – Implement Spanning Tree Protocols
In the output above, the change of Root Port and synchronization to interfaces Fa0/7 and Fa0/8 took less
than six-tenths of a second
DLS1(config-if)# no shut
DLS1(config-if)#
*Mar 1 02:22:38.368: RSTP(110): initializing port Fa0/11
*Mar 1 02:22:38.368: RSTP(110): Fa0/11 is now designated
*Mar 1 02:22:38.393: RSTP(110): transmitting a proposal on Fa0/11
*Mar 1 02:22:38.401: RSTP(110): updt roles, received superior bpdu on Fa0/11
*Mar 1 02:22:38.401: RSTP(110): Fa0/11 is now root port
*Mar 1 02:22:38.401: RSTP(110): Fa0/12 blocked by re-root
*Mar 1 02:22:38.409: RSTP(110): syncing port Fa0/7
*Mar 1 02:22:38.409: RSTP(110): syncing port Fa0/8
*Mar 1 02:22:38.409: RSTP(110): synced Fa0/11
*Mar 1 02:22:38.409: RSTP(110): Fa0/12 is now alternate
*Mar 1 02:22:38.418: STP[110]: Generating TC trap for port FastEthernet0/11
*Mar 1 02:22:38.435: RSTP(110): transmitting an agreement on Fa0/11 as a response to
a proposal
*Mar 1 02:22:38.435: RSTP(110): transmitting a proposal on Fa0/7
*Mar 1 02:22:38.435: RSTP(110): transmitting a proposal on Fa0/8
*Mar 1 02:22:38.653: %LINK-3-UPDOWN: Interface FastEthernet0/11, changed state to up
*Mar 1 02:22:39.659: %LINEPROTO-5-UPDOWN: Line protocol on Interface
FastEthernet0/11, changed state to up
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 29 of 45
CCNPv7.1 SWITCH: Lab 4-1 – Implement Spanning Tree Protocols
In the output above, Fa0/11 is brought back up, and the change of root port and synchronization to interfaces
Fa0/7 and Fa0/8 took one half second. This is a significant improvement from standard spanning tree.
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 30 of 45
CCNPv7.1 SWITCH: Lab 4-1 – Implement Spanning Tree Protocols
ALS1(config-if)# shut
*Mar 1 02:26:58.825: RSTP(120): transmitting a proposal on Fa0/6
*Mar 1 02:27:02.441: %LINK-5-CHANGED: Interface FastEthernet0/6, changed state to
administratively down
*Mar 1 02:27:03.448: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/6,
changed state to down
ALS1(config-if)#
As you can see in the output above, RSTP sees the interface come up, recognizes it as a Designated port,
and starts sending proposals. Now we will add the spanning-tree portfast command to the interface
(the debug is still running):
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 31 of 45
CCNPv7.1 SWITCH: Lab 4-1 – Implement Spanning Tree Protocols
ALS1(config-if)#
ALS1(config-if)# no shut
ALS1(config-if)#
*Mar 1 02:28:13.534: RSTP(120): initializing port Fa0/6
*Mar 1 02:28:13.534: RSTP(120): Fa0/6 is now designated
*Mar 1 02:28:13.945: %LINK-3-UPDOWN: Interface FastEthernet0/6, changed state to up
*Mar 1 02:28:14.952: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/6,
changed state to up
ALS1(config-if)# shut
*Mar 1 02:28:35.999: %LINK-5-CHANGED: Interface FastEthernet0/6, changed state to
administratively down
*Mar 1 02:28:37.006: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/6,
changed state to down
ALS1(config-if)# no shut
ALS1(config-if)#
*Mar 1 02:28:51.434: RSTP(120): initializing port Fa0/6
*Mar 1 02:28:51.434: RSTP(120): Fa0/6 is now designated
ALS1(config-if)#
*Mar 1 02:28:51.761: %LINK-3-UPDOWN: Interface FastEthernet0/6, changed state to up
*Mar 1 02:28:52.768: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/6,
changed state to up
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 32 of 45
CCNPv7.1 SWITCH: Lab 4-1 – Implement Spanning Tree Protocols
Notice in output above that with PortFast configured, no proposals are sent out of interface Fa0/6; the port
goes into Forwarding state immediately.
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 33 of 45
CCNPv7.1 SWITCH: Lab 4-1 – Implement Spanning Tree Protocols
Note(1): PortFast should never be enabled on ports connected to another switches. Doing so could cause a
switching loop. RSTP and MSTP have their own mechanisms to put inter-switch links into Forwarding state
rapidly.
Note(2): On trunk interfaces, configuring the spanning-tree portfast command will have no effect. This
is a safety precaution, as trunks are usually connected to other switches. However, in situations like inter-
VLAN routing using a router-on-stick, or when a trunk is being connected to a server that operates on multiple
VLANs simultaneously, it may still be advantageous, and safe, to allow this trunk to be treated as an edge
port and become Forwarding as soon as it is connected. In these cases, you can use the spanning-tree
portfast trunk command on a trunk port to force a switch to treat it as an edge port regardless of its
operating mode. Be absolutely sure that the device connected to such port is not performing Layer2 switching
before using this command.
Note(3): Because the proper configuration of edge ports in RSTP and MSTP is of such great importance for
proper network performance, Cisco also provides the way of globally configuring the PortFast on all access
ports using the spanning-tree portfast default global configuration command. With this command
configured, each port that operates in the access mode will automatically have PortFast enabled. Trunk ports
will not be affected. The logic of this behavior is simple: Usually, trunk ports connect to other switch where
PortFast should never be enabled, while access ports usually connect to end devices.
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 34 of 45
CCNPv7.1 SWITCH: Lab 4-1 – Implement Spanning Tree Protocols
particular interface using the spanning-tree bpduguard enable command, it will apply to this port
unconditionally, regardless of whether it is a PortFast-enabled port.
For this example, we will configure BPDU guard on a trunking interface that is a non-root port on ALS2.
Configuring BPDU Guard on an interface that is intended to be a trunk is not a recommended practice; we are
doing this just to demonstrate the functionality of the tool.
ALS2# conf t
Enter configuration commands, one per line. End with CNTL/Z.
ALS2(config)# int f0/11
ALS2(config-if)# spanning-tree bpduguard enable
ALS2(config-if)# exit
ALS2(config)#
*Mar 1 02:30:57.792: %SPANTREE-2-BLOCK_BPDUGUARD: Received BPDU on port Fa0/11 with
BPDU Guard enabled. Disabling port.
*Mar 1 02:30:57.792: %PM-4-ERR_DISABLE: bpduguard error detected on Fa0/11, putting
Fa0/11 in err-disable state
*Mar 1 02:30:58.798: %LINEPROTO-5-UPDOWN: Line protocol on Interface
FastEthernet0/11, changed state to down
*Mar 1 02:30:59.813: %LINK-3-UPDOWN: Interface FastEthernet0/11, changed state to
down
As you can see, the interface is almost immediately err-disabled. Revert the configuration settings and issue
the shutdown and no shutdown commands on Fa0/11 to bring it back up.
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 35 of 45
CCNPv7.1 SWITCH: Lab 4-1 – Implement Spanning Tree Protocols
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 36 of 45
CCNPv7.1 SWITCH: Lab 4-1 – Implement Spanning Tree Protocols
You should see a BPDU being received at your host every 2 seconds.
Clear the Wireshark display filter and observe your packet capture window; you will have stopped receiving
BPDUs.
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 37 of 45
CCNPv7.1 SWITCH: Lab 4-1 – Implement Spanning Tree Protocols
From the ALS1 side of things, the root port is interface F0/8. Normally it would be F0/7, but we changed the
port priority of F0/8 to 112, and this impacts root port selection at ALS1 when all interfaces are operational:
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 38 of 45
CCNPv7.1 SWITCH: Lab 4-1 – Implement Spanning Tree Protocols
Configure Root Guard on DLS1 interface Fa0/8 (you may immediately see errors with another VLAN, like 666.
Ignore these as we are focusing on VLAN 100):
DLS1# conf t
Enter configuration commands, one per line. End with CNTL/Z.
DLS1(config)# int f0/8
DLS1(config-if)# spanning-tree guard root
DLS1(config-if)# exit
DLS1(config)#
Then go to ALS1 and configure it to be the root for VLAN 100 using the priority 16384
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 39 of 45
CCNPv7.1 SWITCH: Lab 4-1 – Implement Spanning Tree Protocols
Then back at DLS1, check the spanning tree interface status for Fa0/8:
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.
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 40 of 45
CCNPv7.1 SWITCH: Lab 4-1 – Implement Spanning Tree Protocols
DLS1#
To clear this, go back to ALS1 and issue the command no spanning-tree vlan 100 priority
16384. Once you do this, you will see the following SYSLOG message at DLS1, and the interface will
become consistent again.
DLS1#
*Mar 1 02:54:06.761: %SPANTREE-2-ROOTGUARD_UNBLOCK: Root guard unblocking port
FastEthernet0/8 on VLAN0100.
DLS1# show spanning-tree interface f0/7 | inc VLAN0100
VLAN0100 Desg FWD 19 128.9 P2p
DLS1#
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 41 of 45
CCNPv7.1 SWITCH: Lab 4-1 – Implement Spanning Tree Protocols
DLS1# conf t
Enter configuration commands, one per line. End with CNTL/Z.
DLS1(config)# int f0/8
DLS1(config-if)# no spanning-tree guard root
DLS1(config-if)# exit
DLS1(config)#
VLAN0100
Spanning tree enabled protocol rstp
Root ID Priority 24676
Address e840.406f.7280
Cost 31
Port 7 (FastEthernet0/7)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 42 of 45
CCNPv7.1 SWITCH: Lab 4-1 – Implement Spanning Tree Protocols
Here ALS2 tells us that its path to the root is via Fa0/7 (connected to DLS2) with a total cost of 31, while
Fa0/11 and 12 (connected to ALS1) are Alternate ports. Fa0/11 and Fa0/12 are alternate ports because the
interface cost plus the cost advertised by ALS1 equals 39, which is greater than the local interface cost plus
the cost advertised by DLS2. Fa0/7 has a locally configured cost of 12. That plus the 19 advertised by DLS2
equals 31. You can see these details in the output of show spanning-tree detail
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 43 of 45
CCNPv7.1 SWITCH: Lab 4-1 – Implement Spanning Tree Protocols
Shortly after doing this, you should receive the following SYSLOG message on ALS2 for every VLAN that had
Fa0/11 as an Alternate port:
ALS2#
*Mar 1 03:22:36.795: %SPANTREE-2-LOOPGUARD_BLOCK: Loop guard blocking port
FastEthernet0/11 on VLAN0100.
*Mar 1 03:22:37.802: %SPANTREE-2-LOOPGUARD_BLOCK: Loop guard blocking port
FastEthernet0/11 on VLAN0099.
ALS2# show spanning-tree inconsistentports
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 44 of 45
CCNPv7.1 SWITCH: Lab 4-1 – Implement Spanning Tree Protocols
ALS2#
Fix this by reversing the configuration at ALS1 and verifying at ALS2:
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 45 of 45