Cisco Routing/Switching – Spanning Tree Protocol Lab 2

Continuation from Lab 1, here we will modify the bridge priority to elect our Root Bridge of choice and our secondary root.

Let’s refer to our diagram below:

Seems the most links come into the top two switches here so it’s logical for us to make these the Root and Secondary, think of it as the top two Switches are big Distribution Switches and the bottom three are just Access Switches in cabinets elsewhere, it would make sense to push the majority of traffic through the bigger switches as they can handle bandwidth better.

You can configure this multiple ways, I will show you both.

Configure the Priority of the Switch to influence the Root Election

As we can see from the show spanning-tree command Switch1 is currently not the Root Bridge:

Switch1#sh spanning-tree 
VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    32769
             Address     0007.ECD2.E8A0
             Cost        19
             Port        3(FastEthernet0/3)
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)
             Address     000C.85B6.8792
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  20

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/3            Root FWD 19        128.3    P2p
Fa0/5            Desg FWD 19        128.5    P2p
Fa0/1            Desg FWD 19        128.1    P2p
Fa0/4            Desg FWD 19        128.4    P2p

Switch1#

We can see that it’s a single link (FA0/3) with a cost of 19 (1 hop via Fast Ethernet)

So let’s make this the root Bridge:

Switch1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch1(config)#spanning-tree vlan 1 priority 4096
Switch1(config)#

This will be the lowest priority and you can manually tweak this in increments of 4096, after our conversion time of 30 seconds we should then see that this is the root bridge by running the show spanning-tree command again:

Switch1#sh spanning-tree 
VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    4097
             Address     000C.85B6.8792
             This bridge is the root
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    4097  (priority 4096 sys-id-ext 1)
             Address     000C.85B6.8792
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  20

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/3            Desg FWD 19        128.3    P2p
Fa0/5            Desg FWD 19        128.5    P2p
Fa0/1            Desg FWD 19        128.1    P2p
Fa0/4            Desg FWD 19        128.4    P2p

Switch1#

And indeed we can see this is now the Root Bridge with the ID we set of 4096 and all of its ports are now designated as they should be.

We now want our Alternative Switch (Switch 2) to become our Alternative Root Bridge so we need to tweak that to ensure that is elected as alternative

Switch2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch2(config)#spanning-tree vlan 1 priority 8192
Switch2(config)#

We can simply set this as 8192 (4096×2) and this will act as the alternative as the default is 32768 (Plus VLAN ID)

So if we were to take down all ports on Switch 1 – Switch 2 would then take priority and become the root bridge:

Switch2#sh spanning-tree 
VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    8193
             Address     00D0.D3ED.C354
             This bridge is the root
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    8193  (priority 8192 sys-id-ext 1)
             Address     00D0.D3ED.C354
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  20

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/3            Desg FWD 19        128.3    P2p
Fa0/4            Desg FWD 19        128.4    P2p
Fa0/5            Desg FWD 19        128.5    P2p

Switch2#

The Easier Way

There is an easier way, you can do the alternative below:

Switch1(config)#spanning-tree vlan 1 root primary
Switch1(config)#do sh spanning-tree
VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    20481
             Address     000C.85B6.8792
             This bridge is the root
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    20481  (priority 20480 sys-id-ext 1)
             Address     000C.85B6.8792
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  20

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/3            Desg FWD 19        128.3    P2p
Fa0/5            Desg LSN 19        128.5    P2p
Fa0/1            Desg FWD 19        128.1    P2p
Fa0/4            Desg FWD 19        128.4    P2p

Switch1(config)#

This command will work out the differences in all the switch Priorities and then it will set the priority to an appropriate number within the 4096 increment

The same occurs in the Alternative as below:

Switch2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch2(config)#spanning-tree vlan 1 root secondary
Switch2(config)#do sh spanning-tree
VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    20481
             Address     000C.85B6.8792
             Cost        19
             Port        1(FastEthernet0/1)
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    28673  (priority 28672 sys-id-ext 1)
             Address     00D0.D3ED.C354
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  20

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/3            Desg LSN 19        128.3    P2p
Fa0/4            Desg LSN 19        128.4    P2p
Fa0/1            Root FWD 19        128.1    P2p
Fa0/5            Altn BLK 19        128.5    P2p

As you can see this has appropriately configured the Switch’s Priority to the second lowest to act as alternative.

 

Leave a Reply

Your email address will not be published. Required fields are marked *