show spanning-tree and choosing the root bridge
Sign in to read this lesson
Spanning tree is on by default on Cisco switches. show spanning-tree shows, per VLAN, the root bridge information (Root ID, cost, root port), the local switch's Bridge ID (priority + sys-id-ext), the timers, and each interface's role (Root, Desg, Altn) and state (FWD, BLK). From the output of three switches you can draw the whole topology. There are two ways to change the root bridge: the "spanning-tree vlan 1 root primary" macro and the "spanning-tree vlan 1 priority 4096" command. The priority must be a multiple of 4096.
What you will learn
show spanning-treeis the most important STP command. The Root ID section shows the root bridge and the cost to reach it; Port is the root port. On the root itself it says "This bridge is the root".- Bridge ID:
Priority 32769 (priority 32768 sys-id-ext 1). sys-id-ext = the VLAN number, which the switch adds to the priority. - The interface table: Role (Root, Desg, Altn), Sts (FWD, BLK), Cost (100 Mbit = 19), Prio.Nbr (port priority.port number, for example 128.16), Type (P2p).
- Changing the root bridge:
spanning-tree vlan 1 root primary(a macro: sets the priority to 24576 or below the current root) orspanning-tree vlan 1 priority 4096(a multiple of 4096, 0–61440). - When the root changes, the whole topology is recalculated: other ports may be blocked. So plan the root bridge in advance on the core switch. For a backup root use
root secondary(28672).
The lesson has 5 key points, an explanation and 5 questions. It opens with a package.