120 Labs for Cisco CCNA 200-125 and CCENT Exams

Lab 68: Configuring Spanning Tree Protocol Root Bridges Using the IOS Macro

Lab Objective:

The objective of this lab exercise is to use the macro in Cisco IOS to configure a switch to automatically adjust its Spanning Tree priority for a particular VLAN, or group of VLANs, ensuring that it is the most likely elected root bridge.

Lab Purpose:

VLAN root bridge configuration is a fundamental skill. It is always recommended that the root bridge be manually configured to ensure that the Layer 2 network is deterministic. However, the macro available in Cisco IOS can also be used. As a Cisco engineer, as well as in the Cisco CCNA exam, you will be expected to know how to configure a switch as a root bridge using the macro available in Cisco IOS.

Certification Level:

This lab is suitable for ICND2 and CCNA certification exam preparation.

Lab Difficulty:

This lab has a difficulty rating of 6/10.

Readiness Assessment:

When you are ready for your certification exam, you should complete this lab in no more than 15 minutes.

Lab Topology:

Please use the following topology to complete this lab exercise:

Task 1:

In preparation for VLAN configuration, configure a hostname on Sw1 and Sw2 and configure the VLANs depicted in the topology above.

Task 2:

Configure the switches to support the VLANs listed in the topology. Configure the VLANs and check that they are visible on both switches. Configure FastEthernet0/1 on both switches as a trunk.

Task 3:

Configure Sw1 as the root bridge for VLANs 2010 and 2030.  Configure Sw2 as the root bridge for VLANS 2020 and 2040. Configure the switches to automatically update their priorities as follows:

a.  Sw1 will always be the root bridge for VLANs 2010 and 2030 and Sw2 will always be the backup root bridge for those VLANs.

b.  Sw2 will always be the root bridge for VLANs 2020 and 2040 and Sw1 will always be the backup root bridge for those VLANs.

Task 4:

Verify your configurations with the appropriate commands.

Configuration and Verification

Task 1:

For reference information on configuring hostnames, please refer to earlier labs.

Task 2:

NOTE: By default, Cisco switches are VTP servers. However, to configure the extended range of VLANs (i.e., VLANs 1006 and above), you need to configure the switch as a VTP Transparent switch.

For reference information on Transparent mode, trunks, and extended VLANs, please refer to earlier labs.

Task 3:

NOTE: The spanning-tree vlan <number> root primary command is a macro that allows Catalyst Switches to automatically configure a Spanning Tree priority value that ensures that the switch this command is issued on will most likely be elected as root bridge. The spanning-tree vlan <number> root secondary is a macro that allows Catalyst Switches to automatically configure a Spanning Tree priority value that ensures that the switch this command is issued on will most likely be elected as backup root bridge.

Sw1#conf t 
Enter configuration commands, one per line.  End with CTRL/Z. 
Sw1(config)#spanning-tree vlan2010 root primary 
Sw1(config)#spanning-tree vlan2030 root primary 
Sw1(config)#spanning-tree vlan2020 root secondary 
Sw1(config)#spanning-tree vlan2040 root secondary 
Sw1(config)#end
Sw1# 

Sw1#conf t 
Enter configuration commands, one per line.  End with CTRL/Z. 
Sw2(config)#spanning-tree vlan2020 root primary 
Sw2(config)#spanning-tree vlan2040 root primary 
Sw2(config)#spanning-tree vlan2010 root secondary 
Sw2(config)#spanning-tree vlan2030 root secondary 
Sw2(config)#end 
Sw2#

Task 4:

NOTE: Verify the same for VLAN 2030 on Sw1, as well as for VLANs 2020 and 2040 on Sw2. In addition, you can also issue the show spanning-tree root command to view the Spanning Tree root bridge for all VLANs in the domain. This is illustrated below:

Sw1#show spanning-tree root 

                                              Root Hello Max Fwd 
Vlan                   Root ID          Cost  Time Age Dly  Root Port 
---------------- -------------------- ------ ----- --- ---  ---------- 
VLAN2010         26586 000d.bd06.4100      0    2   20  15 

Sw1#show spanning-tree vlan2010 

VLAN2010 
 Spanning tree enabled protocol ieee 
 Root ID    Priority    26586 
               Address     000d.bd06.4100              
    This bridge is the root 
               Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec 
Bridge ID  Priority    26586  (priority 24576 sys-id-ext 2010)
                 Address     000d.bd06.4100 
                 Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 
                 sec Aging Time 300 

Interface        Role Sts Cost      Prio.Nbr Type 
---------------- ---- --- --------- -------- ------------------------- 
Fa0/1            Desg FWD 100       128.2    Shr

NOTE:  Notice the strange priority value. This means that there is no switch in the switched LAN that has a priority that is numerically less than the manually set value of 28672. To test the macro, change the priority of VLAN2010 on switch Sw2 to 20480 and then check the priority on Sw1 again. Try the reverse and change priorities on Sw1. You should see the Sw2 Spanning Tree priority values change.

Related Articles

Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Inline Feedbacks
View all comments
Back to top button