.What command would you run to determine which switch is the root bridge for a particular VLAN?
A. show spantree vlan
B. show spanning tree
C. show vlan spantree
D. show spanning-tree vlan
E. show spanning-tree interface
Correct Answer: D
The show spanning-tree vlan command provides Spanning Tree Protocol (STP) information on the root switch, including the bridge ID, root path, and root cost, as well as information
on the local switch. The output of the command is as follows:
This output indicates the following:
The root switch has a bridge ID (Priority + MAC Address) of 0-000c.00d3.5124, while the local switch has a bridge ID of 32769-000c.14f5.b5c0. This indicates that the local switch
is not the root switch for VLAN 1. Additional evidence that the local switch is not the root switch is the fact that the Fa0/1 port is blocking with a role listed as Altn. Only non- root
bridges have blocking ports.
For this switch, Fa0/1 represents the redundant link that needs to be blocked to prevent a switching loop.
Interface Fa0/2 is the root port (the interface with the shortest path to the root switch).
All three links have a cost of 19, which is the default cost of a single FastEthernet link.
802.1d is enabled in this switch, as indicated by the output Spanning tree enabled protocol ieee in line 2.
The show spanning-tree interface command will indicate the port role and state that a particular interface plays in each VLAN, but does not indicate the root bridge for a particular
VLAN. Below is sample output from the show spanning-tree interface fastethernet0/1 command. In this example, RSTP is in use rather than 802.1d.
In the above output, the Fa0/1 interface is not the root bridge for any of the three VLANs. It is the root port for VLANs 2 and 3. Root bridges have only designated ports. It is the
alternate port for VLAN1, which means that Fa0/1 has a higher cost path to the root bridge than another interface in the topology, and will be in a blocking state as long as that other
path is available.
The other options are incorrect because they are not valid Cisco IOS commands. The correct syntax would be show spanning-tree, not show spanning tree or show spantree.
LAN Switching Fundamentals
Configure, verify, and troubleshoot STP protocols
Cisco > Cisco IOS Switching Command Reference > show spanning-tree