Cisco Systems, Inc.(R)    Cisco | Profile | Contacts & Feedback | Help
Cisco SMB Support Assistant
Configure Spanning Tree Protocol (STP) on a Catalyst Switch that runs Catalyst OS (CatOS) Software
Home > Work With My Switches > Cisco Catalyst Switches > Configure Spanning Tree Protocol (STP) on a Catalyst Switch that runs Catalyst OS (CatOS) Software  
 

Configure Spanning Tree Protocol (STP) on a Catalyst Switch that runs Catalyst OS (CatOS) Software




Introduction

This document provides instructions on how to configure the Spanning Tree Protocol (STP) on a Catalyst switch that runs Catalyst OS (CatOS) Software.

Spanning Tree Protocol (STP) is a Layer 2 protocol that runs on bridges and switches. The specification for STP is IEEE 802.1D. Spanning tree allows a network design to include spare (redundant) links to provide automatic backup paths if an active link fails, without the danger of bridge loops, or the need for manual enabling/disabling of these backup links. The main purpose of STP is to ensure that you do not create loops when you have redundant paths in your network. Loops are deadly to a network and can consume all available CPU resources and bandwidth.


Back to Top



Requirements

To perform the steps described in this document, you need to have this equipment:

  • A switch with Catalyst OS (CatOS) software version 6.3 or later that is installed and powered on.

  • You must have completed the initial configuration in Configure a Catalyst Switch with Cisco Network Assistant document.

  • A console cable. For more information about cables, refer to Cable Descriptions.

  • Terminal emulation software such as HyperTerminal.

    Note: For more information on how to create a terminal connection, refer to Create a HyperTerminal Connection.

  • Complete the LAN Addressing Worksheet, Management VLAN Worksheet, Secure Server VLAN Worksheet, Guest VLAN Worksheet as instructed in the Site Survey.


Back to Top



Connect your PC to the Catalyst Switch

Follow these steps to connect your PC to the Catalyst Switch:

  1. Connect a PC to the switch with a console cable.

  2. Create a HyperTerminal connection to your switch. For more information, refer to Create a HyperTerminal Connection.

  3. Log into the switch with the login and password that you entered in fields B10 and B11 of the switch Worksheet.

    Username:admin
    Password:

    Note: If you do not know the password for your switch, refer to Manually Reset the Password on a Catalyst Switch.

  4. Type enable and press Enter to access the privileged mode. Type the enable password that you entered in field S5 of the Switch Port Assignment Worksheet.

    Switch_CatOS>enable
    Password:
    Switch_CatOS><enable>

Back to Top



Configure Spanning Tree Protocol

This section explains how to configure the Spanning Tree Protocol on a Catalyst Switch.

Configure the Spanning-Tree Mode

The switch supports three spanning-tree modes: PVST+, rapid PVST+, or MSTP. By default, the switch runs the PVST+ protocol. For more information on modes refer to Prepare to Configure Spanning Tree Protocol on a Catalyst Switch.

Follow these steps to change the spanning-tree mode if you want to enable a mode that is different from the default mode of PVST+.

  1. Type set spantree mode {pvst+ | mst | rapid-pvst+ |mistp | mistp-pvst+} and press Enter to configure a spanning-tree mode. In this example, PVST+ is selected which enables PVST+ spanning-tree mode.

    Switch_CatOS><enable>set spantree mode pvst+
    

    Note: The default mode is rapid- pvst+

  2. Type show spanning-tree summary and press Enter to verify your configuration.

    Switch_CatOS><enable>show spantree
    VLAN 1
    Spanning tree mode          PVST+
    Spanning tree type          ieee
    Spanning tree enabled
    
    Designated Root             00-09-e9-19-94-80
    Designated Root Priority    32768
    Designated Root Cost        0
    Designated Root Port        1/0
    Root Max Age   20 sec   Hello Time 2  sec   Forward Delay 15 sec
    
    Bridge ID MAC ADDR          00-09-e9-19-94-80
    Bridge ID Priority          32768
    Bridge Max Age 20 sec   Hello Time 2  sec   Forward Delay 15 sec
    
    Port                     State         Role Cost     Prio Type
    ------------------------ ------------- ---- -------- ---- ------------------
     2/1                     not-connected  -          4   32
     2/2                     not-connected  -          4   32
     3/1                     forwarding    DESG      100   32 Shared, PEER(STP)
     3/2                     not-connected  -        100   32
     3/3                     forwarding    DESG       19   32 P2P
    
    ----Output truncated for brevity------

Configure the Root Switch

The switch maintains a separate spanning-tree instance for each active VLAN configured on it. A bridge ID, consists of the switch priority and the switch MAC address, is associated with each instance. For each VLAN, the switch with the lowest bridge ID becomes the root switch for that VLAN.

Follow these steps to configure the Root switch:

  1. Type set spantree root vlan_id command and press Enter in order to set the priority of the switch to 8192 for the VLAN. The vlan_id is the Default VLAN number which you entered in the field L7A of the LAN Addressing Worksheet.

    Note: The default priority for switches is 32768. When you set the priority with this command, you force the selection of the configured switch as the root switch for the particular VLAN number as it has the lowest priority value of 8192.

    Switch_CatOS><enable>set spanning-tree root 20
    VLAN 20 bridge priority set to 8192
    VLAN 20 bridge max aging time unchanged at 20
    VLAN 20 bridge hello time unchanged at 2
    VLAN 20 bridge forward delay unchanged at 15
    Switch is now the root switch for active VLAN 20
  2. Type set spantree root vlan_id command and press Enter in order to set the priority of the switch to 8192 for the VLAN. The vlan_id is the Network Management VLAN number which you entered in the field L7B of the Network Management VLAN Worksheet.

    Switch_CatOS><enable>set spanning-tree root 21
    VLAN 21 bridge priority set to 8192
    VLAN 21 bridge max aging time unchanged at 20
    VLAN 21 bridge hello time unchanged at 2
    VLAN 21 bridge forward delay unchanged at 15
    Switch is now the root switch for active VLAN 21
  3. Type set spantree root vlan_id command and press Enter in order to set the priority of the switch to 8192 for the VLAN. The vlan_id is the Secure Server VLAN number which you entered in the field L7C of the Secure Server VLAN Worksheet.

    Switch_CatOS><enable>set spanning-tree root 22
    VLAN 22 bridge priority set to 8192
    VLAN 22 bridge max aging time unchanged at 20
    VLAN 22 bridge hello time unchanged at 2
    VLAN 22 bridge forward delay unchanged at 15
    Switch is now the root switch for active VLAN 22
  4. Type set spantree root vlan_id command and press Enter in order to set the priority of the switch to 8192 for the VLAN. The vlan_id is the Guest VLAN number which you entered in the field L7D of the Guest VLAN Worksheet.

    Switch_CatOS><enable>set spanning-tree root 23
    VLAN 23 bridge priority set to 8192
    VLAN 23 bridge max aging time unchanged at 20
    VLAN 23 bridge hello time unchanged at 2
    VLAN 23 bridge forward delay unchanged at 15
    Switch is now the root switch for active VLAN 23
  5. If you are not certain that all the switches in your network have a priority that is greater than 1 then set the priority of your desired root bridge to 1. Type set spantree priority 1 vlan_id. In this example the vlan_id is the Default VLAN number which you entered in the field L7A of the LAN Addressing Worksheet.

    Switch_CatOS><enable>set spantree priority 1 20
    
  6. Issue the show spantree vlan_id command in order to verify that this Switch is the root of all the appropriate VLANs.

    From the output of this command, compare the MAC address of the switch that is the root switch to the MAC address of the switch from which you issued the command. If the addresses match, the switch that you are in is the root switch of the VLAN. A root port that is 1/0 also indicates that you are at the root switch. This is the sample command output:

    Switch_CatOS><enable>show spantree 20
    VLAN 20
    spanning-tree enabled
    spanning-tree type          ieee
    
    Designated Root             00-10-0d-b1-78-00
    
    !--- This is the MAC address of the root switch for VLAN 1.
    
    Designated Root Priority    1
    Designated Root Cost        0
    Designated Root Port        1/0
    Root Max Age   20 sec    Hello Time 2  sec   Forward Delay 15 sec
    
    Bridge ID MAC ADDR          00-10-0d-b1-78-00
    Bridge ID Priority          1
    Bridge Max Age 20 sec    Hello Time 2  sec   Forward Delay 15 sec
    This output shows that this Switch is the designated root on the spanning tree 
    for VLAN 20. The MAC address of the designated root switch, 00-10-0d-b1-78-00, 
    is the same as the bridge ID MAC address of Switch, 00-10-0d-b1-78-00. 
    Another indicator that this switch is the designated root is that the designated 
    root port is 1/0.

Configuring a Secondary Root Switch

When you configure a Catalyst switch as the secondary root, the switch priority is modified from the default value (16384) to 28672. The switch is then likely to become the root switch for the specified VLAN if the primary root switch fails. This makes us assume that the other network switches use the default switch priority of 32768 and therefore are unlikely to become the root switch.

You can execute this command on more than one switch to configure multiple backup root switches. Use the same network diameter and hello-time values that you used when you configured the primary root switch with the spanning-tree vlan vlan-id root primary global configuration command.

  1. Log in to the privilege mode of the alternate switch which you want it to become secondary root switch for a specific VLAN.

  2. Type set spantree root secondary 20 and press Enter.

    Switch_CatOS><enable>set spantree root secondary 20
    VLAN 20 bridge priority set to 16384
    VLAN 20 bridge max aging time unchanged at 20
    VLAN 20 bridge hello time unchanged at 2
    VLAN 20 bridge forward delay unchanged at 15.
  3. Type set spantree root secondary 21 and press Enter.

    Switch_CatOS><enable>set spantree root secondary 21
    VLAN 21 bridge priority set to 16384
    VLAN 21 bridge max aging time unchanged at 20
    VLAN 21 bridge hello time unchanged at 2
    VLAN 21 bridge forward delay unchanged at 15.
  4. Type set spantree root secondary 22 and press Enter.

    Switch_CatOS><enable>set spantree root secondary 22
    VLAN 22 bridge priority set to 16384
    VLAN 22 bridge max aging time unchanged at 20
    VLAN 22 bridge hello time unchanged at 2
    VLAN 22 bridge forward delay unchanged at 15.
  5. Type set spantree root secondary 23 and press Enter.

    Switch_CatOS><enable>set spantree root secondary 23
    VLAN 23 bridge priority set to 16384
    VLAN 23 bridge max aging time unchanged at 20
    VLAN 23 bridge hello time unchanged at 2
    VLAN 23 bridge forward delay unchanged at 15.

Configure Port Fast

Spanning-tree Port Fast causes a spanning-tree port to enter the forwarding state immediately, bypassing the listening and learning states. The Port Fast feature must be used only when connecting a single end station or a server to an access or trunk port.

  1. To enable Port Fast on a switch port enter the command set spantree portfast module_num/port_num enable, where module_num and port_num must be replaced with the actual module number and port number in digits.

    switch_CatOS><enable>set spantree portfast 1/1 enable
    
  2. To disable Port Fast on a switch port enter the command set spantree portfast module_num/port_num disable, where module_num and port_num must be replaced with the actual module number and port number in digits.

    switch_CatOS><enable>set spantree portfast 1/1 disable
    

Back to Top



Disabling Spanning Tree

STP is enabled by default on VLAN 1 and on all newly created VLANs up to the spanning-tree limit. Disable STP only if you are sure there are no loops in the network topology.

When STP is disabled and loops are present in the topology, excessive traffic and indefinite packet duplication can drastically reduce network performance.

Follow these steps to disable STP:

  1. Type set spantree disable vlan-id and press Enter to Disable STP on a per-VLAN basis.

    Switch_CatOS><enable>set spantree disable 23
    
  2. Type clear spantree root 1 vlan-id and press Enter to reset the spanning-tree bridge priority value to the default setting.

    Switch_CatOS><enable>clear spantree root 23
    VLAN 23 bridge priority set to 32768.
    VLAN 23 bridge max aging time set to 20.
    VLAN 23 bridge hello time set to 2.
    VLAN 23 bridge forward delay set to 15.

    Note: The switch priority for the VLAN 23 changes to the default value of 32768.


Back to Top



Next Step

You have completed this procedure.

To make further changes to your switch, refer to the Switch Support Page.

To configure other devices in your network, refer to the Configuration Overview Page.


Back to Top



Troubleshoot the Procedure

This section provides information about common problems that you may encounter. If this information does not solve your problem, contact the SMB Technical Assistance Center (SMB TAC) for assistance.

Problem

Cause(s) and Suggested Solution(s)

The switch boots and displays several error messages but does not display a prompt in HyperTerminal.

Press Enter to clear the output and display the switch prompt.

For further assistance, contact the SMB Technical Assistance Center (SMB TAC).


Back to Top



Related Information

Service Requests

  Open a service request
  Update a service request

Feedback

Please rate this site:
++ + +/- - --

Suggestions for improvement:




If Cisco may contact you for more details
or for future feedback opportunities,
please enter your contact information:

Full Name:
Email:



© 1992-2006 Cisco Systems, Inc. All rights reserved. Terms and Conditions, Privacy Statement, Cookie Policy and Trademarks of Cisco Systems, Inc.