How to Configure Spanning Tree on Cisco Switch in GNS3?

How to Configure Spanning Tree on Cisco Switch in GNS3? – When configuring the Original Spanning-Tree Protocol (802.1D) on Layer 2 Cisco Switches, you must enable features such as Port Fast, Uplink Fast, and BackboneFast to improve STP Convergence performance.
How to Configure Spanning Tree on Cisco Switch in GNS3?

How to Configure Spanning Tree on Cisco Switch in GNS3?

How to Configure Spanning Tree on Cisco Switch in GNS3?

You need to enable these features while configuring Spanning Tree Protocol. If you have old Cisco switches, you will probably use the old STP protocol on these switches. In such a case, you need to enable the above-mentioned features in order to increase the performance of the Standard STP protocol.

In our previous script, we examined GNS3 Port Fast Configuration, GNS3 Uplink Fast Configuration, and GNS3 BackboneFast Configuration separately. In this article, we will configure all the STP features we have learned together.

You can also configure Port Fast, Uplink Fast, and BackboneFast using the GNS3 program by following the videos on our YouTube channel.

[su_box title=”Our Recommendation” box_color=”#242424″ radius=”0″]

You can purchase “CCNP Switching” from Amazon.

[/su_box]

How to Configure Spanning Tree in GNS3?

Before proceeding with the Spanning Tree configuration steps in GNS3, browse How to Add Layer 2 Switch in GNS3 and How to Use VPCS in GNS3. Then follow the steps below for Spanning Tree configuration.

   Step 1

Create a new project for configuring Spanning Tree on Cisco Switch in GNS3.

How to Configure Spanning Tree on Cisco Switch in GNS3?

   Step 2

After adding a Layer 2 Switch to the GNS3 program, create a redundant network topology as shown in the following image.Layer 2 Switch to the GNS3 program, create a redundant network topology as shown in the following image.

How to Configure Spanning Tree on Cisco Switch in GNS3?

   Step 3

Configure the TCP/IP configuration of the GNS3 VPCS computers and then test the connection by pinging from VPCS PC1 to VPCS PC5.GNS3 VPCS computers and then test the connection by pinging from VPCS PC1 to VPCS PC5.

How to Configure Spanning Tree on Cisco Switch in GNS3?

How to Elect a Root Bridge in Spanning Tree Protocol in GNS3?

In the following network topology, choosing a Root Bridge at the network distribution layer will make sense. And if there is an error in the Root Bridge Switch, it will be automatically selected the Secondary Root Bridge Switch. That’ why select the L2-SW-2 as follows.

   Step 1

Specify the Root Bridge Switch and Secondary Root Bridge for the following network topology.

How to Configure Spanning Tree on Cisco Switch in GNS3?

   Step 2

Configure the Cisco Switch L2-SW1 as the Root Bridge and the L2-SW-2 Switch as the Secondary Root Bridge. Priority values are taken into consideration when selecting the Manual Root Bridge. You can configure this process in two ways;

1) You can select with the Spanning-tree vlan 1 priority command.
2) You can select with the Spanning-tree vlan 1 root command.

In this article, we will use the Root Primary command when selecting the Root Bridge. To select L2-SW-1 as the Root Bridge, execute the following command and then check with show spanning-tree command.

L2-SW-1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
L2-SW-1(config)#
L2-SW-1(config)#spanning-tree vlan 1 root primary
L2-SW-1(config)#exit
L2-SW-1#
*Sep 27 17:18:03.648: %SYS-5-CONFIG_I: Configured from console by console
L2-SW-1#  
L2-SW-1#show spanning-tree

VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    24577
             Address     003f.181f.4800
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    24577  (priority 24576 sys-id-ext 1)
             Address     003f.181f.4800
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  15  sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Gi0/0               Desg FWD 4         128.1    Shr 
Gi0/1               Desg FWD 4         128.2    Shr 
Gi0/2               Desg FWD 4         128.3    Shr 
Gi0/3               Desg FWD 4         128.4    Shr 
Gi1/0               Desg FWD 4         128.5    Shr 
Gi1/1               Desg FWD 4         128.6    Shr 


L2-SW-1#

 

How to Configure Spanning Tree on Cisco Switch in GNS3?

   Step 3

To configure the Cisco Switch L2-SW-2 as a Secondary Root Bridge, execute the following command and then check the Priority value of the L2-SW-2 Switch.

L2-SW-2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
L2-SW-2(config)#
L2-SW-2(config)#spanning-tree vlan 1 root secondary
L2-SW-2(config)#exit
L2-SW-2#
L2-SW-2#show spanning-tree

VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    24577
             Address     003f.181f.4800
             Cost        4
             Port        1 (GigabitEthernet0/0)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    28673  (priority 28672 sys-id-ext 1)
             Address     003f.18b2.5800
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Gi0/0               Root FWD 4         128.1    Shr 
Gi0/1               Desg FWD 4         128.2    Shr 
Gi0/2               Desg FWD 4         128.3    Shr 
Gi0/3               Desg FWD 4         128.4    Shr 
Gi1/0               Desg FWD 4         128.5    Shr 
Gi1/1               Desg FWD 4         128.6    Shr 

          
L2-SW-2#

 

How to Configure Spanning Tree on Cisco Switch in GNS3?

Determining Spanning Tree Port States on Cisco Switch

For the STP Port cases in the previous chapters, we examined the topic called Examining Spanning-Tree Protocol in GNS3. Determine the Spanning-Tree Port States of the Cisco Switches by following the steps below.

   Step 1

At the L2-SW-2 Switch CLI command prompt, perform the show spanning-tree command and define the port states for Designated, Root and Blocked.

L2-SW-2#show spanning-tree

VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    24577
             Address     003f.181f.4800
             Cost        4
             Port        1 (GigabitEthernet0/0)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    28673  (priority 28672 sys-id-ext 1)
             Address     003f.18b2.5800
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Gi0/0               Root FWD 4         128.1    Shr 
Gi0/1               Desg FWD 4         128.2    Shr 
Gi0/2               Desg FWD 4         128.3    Shr 
Gi0/3               Desg FWD 4         128.4    Shr 
Gi1/0               Desg FWD 4         128.5    Shr 
Gi1/1               Desg FWD 4         128.6    Shr 

          
L2-SW-2#

 
How to Configure Spanning Tree on Cisco Switch in GNS3?

   Step 2

Cisco Switch L2-SW-3 show spanning-tree command output;

L2-SW-3#show spanning-tree 

VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    24577
             Address     003f.181f.4800
             Cost        4
             Port        1 (GigabitEthernet0/0)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)
             Address     003f.18f9.da00
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Gi0/0               Root FWD 4         128.1    Shr 
Gi0/1               Altn BLK 4         128.2    Shr 
Gi0/2               Desg FWD 4         128.3    Shr 
Gi0/3               Desg FWD 4         128.4    Shr 


L2-SW-3#

 
How to Configure Spanning Tree on Cisco Switch in GNS3?

   Step 3

Cisco Switch L2-SW-4 show spanning-tree command output;

L2-SW-4#show spanning-tree 

VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    24577
             Address     003f.181f.4800
             Cost        4
             Port        1 (GigabitEthernet0/0)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)
             Address     003f.18f0.f400
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Gi0/0               Root FWD 4         128.1    Shr 
Gi0/1               Altn BLK 4         128.2    Shr 
Gi0/2               Desg FWD 4         128.3    Shr 
Gi0/3               Desg FWD 4         128.4    Shr 


L2-SW-4#

 
How to Configure Spanning Tree on Cisco Switch in GNS3?

   Step 4

Cisco Switch L2-SW-5 show spanning-tree command output;

L2-SW-5#show spanning-tree 

VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    24577
             Address     003f.181f.4800
             Cost        4
             Port        2 (GigabitEthernet0/1)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)
             Address     003f.183a.3300
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Gi0/0               Altn BLK 4         128.1    Shr 
Gi0/1               Root FWD 4         128.2    Shr 
Gi0/2               Desg FWD 4         128.3    Shr 
Gi0/3               Desg FWD 4         128.4    Shr 


L2-SW-5#

 
How to Configure Spanning Tree on Cisco Switch in GNS3?

   Step 5

Cisco Switch L2-SW-6 show spanning-tree command output;

L2-SW-6#show spanning-tree 

VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    24577
             Address     003f.181f.4800
             Cost        4
             Port        2 (GigabitEthernet0/1)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)
             Address     003f.18a0.2400
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Gi0/0               Altn BLK 4         128.1    Shr 
Gi0/1               Root FWD 4         128.2    Shr 
Gi0/2               Desg FWD 4         128.3    Shr 
Gi0/3               Desg FWD 4         128.4    Shr 


L2-SW-6#

 
How to Configure Spanning Tree on Cisco Switch in GNS3?

   Step 6

Cisco Switch L2-SW-7 show spanning-tree command output;

L2-SW-7#show spanning-tree 

VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    24577
             Address     003f.181f.4800
             Cost        4
             Port        1 (GigabitEthernet0/0)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)
             Address     003f.1870.d400
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  15  sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Gi0/0               Root FWD 4         128.1    Shr 
Gi0/1               Altn BLK 4         128.2    Shr 
Gi0/2               Desg FWD 4         128.3    Shr 
Gi0/3               Desg FWD 4         128.4    Shr 


L2-SW-7#

 
How to Configure Spanning Tree on Cisco Switch in GNS3?

How to Configure Spanning Tree PortFast on Cisco Switch?

To configure Spanning Tree PortFast on Cisco Switches, perform the following commands on the Switch interfaces where the VPCS PCs are connected and verify the PortFast configuration with the show running-config | begin interface GigabitEthernet0/3 command.

The purpose of configuring Spanning Tree PortFast in Layer 2 Switches is to ensure that interfaces configured as PortFast are not to processed STP Convergence in the BPDU packet exchange.

   Step 1

Cisco Switch L2-SW-3 Spanning Tree PortFast configuration process;

L2-SW-3#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
L2-SW-3(config)#interface gigabitethernet0/3
L2-SW-3(config-if)#spanning-tree portfast
%Warning: portfast should only be enabled on ports connected to a single
 host. Connecting hubs, concentrators, switches, bridges, etc... to this
 interface  when portfast is enabled, can cause temporary bridging loops.
 Use with CAUTION

%Portfast has been configured on GigabitEthernet0/3 but will only
 have effect when the interface is in a non-trunking mode.
L2-SW-3(config-if)#exit
L2-SW-3(config)#exit
L2-SW-3#
*Sep 27 17:40:32.880: %SYS-5-CONFIG_I: Configured from console by console
L2-SW-3#show run | begin interface GigabitEthernet0/3
interface GigabitEthernet0/3
 media-type rj45
 negotiation auto
 spanning-tree portfast
!

 
How to Configure Spanning Tree on Cisco Switch in GNS3?

   Step 2

Cisco Switch L2-SW-4 Spanning Tree PortFast configuration process;

L2-SW-4#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
L2-SW-4(config)#interface gigabitethernet0/3
L2-SW-4(config-if)#spanning-tree portfast
%Warning: portfast should only be enabled on ports connected to a single
 host. Connecting hubs, concentrators, switches, bridges, etc... to this
 interface  when portfast is enabled, can cause temporary bridging loops.
 Use with CAUTION

%Portfast has been configured on GigabitEthernet0/3 but will only
 have effect when the interface is in a non-trunking mode.
L2-SW-4(config-if)#exit
L2-SW-4(config)#exit
L2-SW-4#
*Sep 27 17:41:23.448: %SYS-5-CONFIG_I: Configured from console by console
L2-SW-4#show run | begin interface GigabitEthernet0/3
interface GigabitEthernet0/3
 media-type rj45
 negotiation auto
 spanning-tree portfast
!

 
How to Configure Spanning Tree on Cisco Switch in GNS3?

   Step 3

Cisco Switch L2-SW-5 Spanning Tree PortFast configuration process;

L2-SW-5#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
L2-SW-5(config)#interface gigabitethernet0/3
L2-SW-5(config-if)#spanning-tree portfast
%Warning: portfast should only be enabled on ports connected to a single
 host. Connecting hubs, concentrators, switches, bridges, etc... to this
 interface  when portfast is enabled, can cause temporary bridging loops.
 Use with CAUTION

%Portfast has been configured on GigabitEthernet0/3 but will only
 have effect when the interface is in a non-trunking mode.
L2-SW-5(config-if)#exit
L2-SW-5(config)#exit
L2-SW-5#
*Sep 27 17:44:49.861: %SYS-5-CONFIG_I: Configured from console by console
L2-SW-5#show run | begin interface GigabitEthernet0/3
interface GigabitEthernet0/3
 media-type rj45
 negotiation auto
 spanning-tree portfast
!

 
How to Configure Spanning Tree on Cisco Switch in GNS3?

   Step 4

Cisco Switch L2-SW-6 Spanning Tree PortFast configuration process;

L2-SW-6#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
L2-SW-6(config)#interface gigabitethernet0/3
L2-SW-6(config-if)#spanning-tree portfast
%Warning: portfast should only be enabled on ports connected to a single
 host. Connecting hubs, concentrators, switches, bridges, etc... to this
 interface  when portfast is enabled, can cause temporary bridging loops.
 Use with CAUTION

%Portfast has been configured on GigabitEthernet0/3 but will only
 have effect when the interface is in a non-trunking mode.
L2-SW-6(config-if)#exit
L2-SW-6(config)#exit
L2-SW-6#
*Sep 27 17:45:26.583: %SYS-5-CONFIG_I: Configured from console by console
L2-SW-6#show run | begin interface GigabitEthernet0/3
interface GigabitEthernet0/3
 media-type rj45
 negotiation auto
 spanning-tree portfast
!

 
How to Configure Spanning Tree on Cisco Switch in GNS3?

   Step 5

Cisco Switch L2-SW-7 Spanning Tree PortFast configuration process;

L2-SW-7#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
L2-SW-7(config)#interface gigabitethernet0/2 
L2-SW-7(config-if)#spanning-tree portfast
%Warning: portfast should only be enabled on ports connected to a single
 host. Connecting hubs, concentrators, switches, bridges, etc... to this
 interface  when portfast is enabled, can cause temporary bridging loops.
 Use with CAUTION

%Portfast has been configured on GigabitEthernet0/2 but will only
 have effect when the interface is in a non-trunking mode.
L2-SW-7(config-if)#exit
L2-SW-7(config)#exit
L2-SW-7#
*Sep 27 17:55:22.994: %SYS-5-CONFIG_I: Configured from console by console
L2-SW-7#show run | begin interface GigabitEthernet0/2
interface GigabitEthernet0/2
 media-type rj45
 negotiation auto
 spanning-tree portfast
!

 
How to Configure Spanning Tree on Cisco Switch in GNS3?

How to Configure Spanning Tree UplinkFast on Cisco Switch?

The purpose of Spanning Tree UplinkFast configuration on Cisco Layer 2 Switches is to immediately switch from the Blocking ports to the Forwarding modes in the link failure.

In the config mode of Cisco Switches with the Blocked port in the network topology, run the following commands in order, and use the show running-config | begin spanning-tree command to check Spanning Tree UplinkFast configuration.

   Step 1

Switch L2-SW-3 Spanning Tree UplinkFast configuration operation;

L2-SW-3#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
L2-SW-3(config)# 
L2-SW-3(config)#spanning-tree uplinkfast
L2-SW-3(config)#exit
L2-SW-3#
*Sep 27 17:58:58.051: %SYS-5-CONFIG_I: Configured from console by console
L2-SW-3#
L2-SW-3#show run | begin spanning-tree
spanning-tree mode pvst
spanning-tree extend system-id
spanning-tree uplinkfast
!

 
How to Configure Spanning Tree on Cisco Switch in GNS3?

   Step 2

Switch L2-SW-4 Spanning Tree UplinkFast configuration operation;

L2-SW-4#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
L2-SW-4(config)#spanning-tree uplinkfast
L2-SW-4(config)#exit
L2-SW-4#
*Sep 27 17:59:54.981: %SYS-5-CONFIG_I: Configured from console by console
L2-SW-4#
L2-SW-4#show run | begin spanning-tree
spanning-tree mode pvst
spanning-tree extend system-id
spanning-tree uplinkfast
!

 
How to Configure Spanning Tree on Cisco Switch in GNS3?

   Step 3

Switch L2-SW-5 Spanning Tree UplinkFast configuration operation;

L2-SW-5#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
L2-SW-5(config)#spanning-tree uplinkfast
L2-SW-5(config)#exit
L2-SW-5#
*Sep 27 18:00:48.637: %SYS-5-CONFIG_I: Configured from console by console
L2-SW-5#
L2-SW-5#show run | begin spanning-tree
spanning-tree mode pvst
spanning-tree extend system-id
spanning-tree uplinkfast
!

 
How to Configure Spanning Tree on Cisco Switch in GNS3?

   Step 4

Switch L2-SW-6 Spanning Tree UplinkFast configuration operation;

L2-SW-6#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
L2-SW-6(config)#spanning-tree uplinkfast
L2-SW-6(config)#exit
L2-SW-6#
*Sep 27 18:01:21.928: %SYS-5-CONFIG_I: Configured from console by console
L2-SW-6#
L2-SW-6#show run | begin spanning-tree
spanning-tree mode pvst
spanning-tree extend system-id
spanning-tree uplinkfast
!

 
How to Configure Spanning Tree on Cisco Switch in GNS3?

   Step 5

Switch L2-SW-7 Spanning Tree UplinkFast configuration operation;

L2-SW-7#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
L2-SW-7(config)#spanning-tree uplinkfast
L2-SW-7(config)#exit
L2-SW-7#
*Sep 27 18:04:16.250: %SYS-5-CONFIG_I: Configured from console by console
L2-SW-7#
L2-SW-7#show run | begin spanning-tree
spanning-tree mode pvst
spanning-tree extend system-id
spanning-tree uplinkfast
!

 
How to Configure Spanning Tree on Cisco Switch in GNS3?

How to Configure Spanning Tree BackboneFast on Cisco Switch?

You need to enable the BackboneFast feature on all Cisco Layer 2 Switches on the network topology. The BackboneFast feature saves 20 seconds by bypassing the Max Age Timer feature. As a result, STP Convergence takes 30 seconds.

Follow the steps below to configure Spanning Tree BackboneFast on Cisco Switches in the network topology. Then activate the BackboneFast feature by using the spanning-tree backbonefast command at the CLI command prompt of the switches.

Finally, to verify the Spanning Tree BackboneFast configuration, use the show running-config | begin spanning-tree command.

   Step 1

Cisco L2-SW-1 Spanning Tree BackboneFast configuration process;

L2-SW-1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
L2-SW-1(config)#spanning-tree backbonefast
L2-SW-1(config)#exit
L2-SW-1#
*Sep 27 18:03:17.737: %SYS-5-CONFIG_I: Configured from console by consoles    
% Type "show ?" for a list of subcommands
L2-SW-1#
L2-SW-1#show run | begin spanning-tree
spanning-tree mode pvst
spanning-tree extend system-id
spanning-tree backbonefast
spanning-tree vlan 1 priority 24576
!

 
How to Configure Spanning Tree on Cisco Switch in GNS3?

   Step 2

Cisco L2-SW-2 Spanning Tree BackboneFast configuration process;

L2-SW-2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
L2-SW-2(config)#spanning-tree backbonefast
L2-SW-2(config)#exit
L2-SW-2#
*Sep 27 18:03:52.824: %SYS-5-CONFIG_I: Configured from console by console
L2-SW-2#
L2-SW-2#show run | begin spanning-tree
spanning-tree mode pvst
spanning-tree extend system-id
spanning-tree backbonefast
spanning-tree vlan 1 priority 28672
!

 
How to Configure Spanning Tree on Cisco Switch in GNS3?

   Step 3

Cisco L2-SW-3 Spanning Tree BackboneFast configuration process;

L2-SW-3#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
L2-SW-3(config)#spanning-tree backbonefast
L2-SW-3(config)#exit
L2-SW-3#
*Sep 27 18:04:44.459: %SYS-5-CONFIG_I: Configured from console by console
L2-SW-3#
L2-SW-3#show run | begin spanning-tree
spanning-tree mode pvst
spanning-tree extend system-id
spanning-tree uplinkfast
spanning-tree backbonefast
!

 
How to Configure Spanning Tree on Cisco Switch in GNS3?

   Step 4

Cisco L2-SW-4 Spanning Tree BackboneFast configuration process;

L2-SW-4#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
L2-SW-4(config)#spanning-tree backbonefast
L2-SW-4(config)#
L2-SW-4(config)#do show run | begin spanning-tree
spanning-tree mode pvst
spanning-tree extend system-id
spanning-tree uplinkfast
spanning-tree backbonefast
!

 
How to Configure Spanning Tree on Cisco Switch in GNS3?

   Step 5

Cisco L2-SW-5 Spanning Tree BackboneFast configuration process;

L2-SW-5#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
L2-SW-5(config)#spanning-tree backbonefast
L2-SW-5(config)#
L2-SW-5(config)#do show run | begin spanning-tree
spanning-tree mode pvst
spanning-tree extend system-id
spanning-tree uplinkfast
spanning-tree backbonefast
!

 
How to Configure Spanning Tree on Cisco Switch in GNS3?

   Step 6

Cisco L2-SW-6 Spanning Tree BackboneFast configuration process;

L2-SW-6#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
L2-SW-6(config)#spanning-tree backbonefast
L2-SW-6(config)#
L2-SW-6(config)#do show run | begin spanning-tree
spanning-tree mode pvst
spanning-tree extend system-id
spanning-tree uplinkfast
spanning-tree backbonefast
!

 
How to Configure Spanning Tree on Cisco Switch in GNS3?

   Step 7

Cisco L2-SW-7 Spanning Tree BackboneFast configuration process;

L2-SW-7#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
L2-SW-7(config)#spanning-tree backbonefast
L2-SW-7(config)#
L2-SW-7(config)#do show run | begin spanning-tree
spanning-tree mode pvst
spanning-tree extend system-id
spanning-tree uplinkfast
spanning-tree backbonefast
!

 
How to Configure Spanning Tree on Cisco Switch in GNS3?

How to Configure BPDU Guard on Cisco Switch in GNS3?

Finally, we will perform Spanning Tree BPDU Guard configuration steps for the switches on the network topology. We will configure BPDU Guard on Spanning Tree PortFast configured Cisco switches.

For Spanning Tree BPDU Guard configuration, apply the spanning-tree portfast bpduguard command in the config mode of the switches, and then use the show running-config | begin spanning-tree command to verify Spanning Tree BPDU Guard.

If the BPDU Guard is activated, the BPDU Guard will immediately close the PortFast port if BPDU is received via the enabled interface. Therefore we need to manually activate the closed port. If you want to automate this situation, apply the following commands;

1) errdisable recovery cause bpduguard
2) errdisable recovery interval 400

   Step 1

L2-SW-3 Switch Spanning Tree BPDU Guard configuration process;

L2-SW-3#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
L2-SW-3(config)#spanning-tree portfast bpduguard
L2-SW-3(config)#errdisable recovery cause bpduguard
L2-SW-3(config)#errdisable recovery interval 400   
L2-SW-3(config)#
L2-SW-3(config)#do show run | begin spanning-tree
spanning-tree mode pvst
spanning-tree portfast bpduguard default
spanning-tree extend system-id
spanning-tree uplinkfast
spanning-tree backbonefast
!

 
How to Configure Spanning Tree on Cisco Switch in GNS3?

   Step 2

L2-SW-4 Switch Spanning Tree BPDU Guard configuration process;

L2-SW-4#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
L2-SW-4(config)#spanning-tree portfast bpduguard
L2-SW-4(config)#errdisable recovery cause bpduguard
L2-SW-4(config)#errdisable recovery interval 400
L2-SW-4(config)#
L2-SW-4(config)#do show run | begin spanning-tree
spanning-tree mode pvst
spanning-tree portfast bpduguard default
spanning-tree extend system-id
spanning-tree uplinkfast
spanning-tree backbonefast
!

 
How to Configure Spanning Tree on Cisco Switch in GNS3?

   Step 3

L2-SW-5 Switch Spanning Tree BPDU Guard configuration process;

L2-SW-5#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
L2-SW-5(config)#spanning-tree portfast bpduguard
L2-SW-5(config)#errdisable recovery cause bpduguard
L2-SW-5(config)#errdisable recovery interval 400
L2-SW-5(config)#
L2-SW-5(config)#do show run | begin spanning-tree
spanning-tree mode pvst
spanning-tree portfast bpduguard default
spanning-tree extend system-id
spanning-tree uplinkfast
spanning-tree backbonefast
!

 
How to Configure Spanning Tree on Cisco Switch in GNS3?

   Step 4

L2-SW-6 Switch Spanning Tree BPDU Guard configuration process;

L2-SW-6#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
L2-SW-6(config)#spanning-tree portfast bpduguard
L2-SW-6(config)#errdisable recovery cause bpduguard
L2-SW-6(config)#errdisable recovery interval 400
L2-SW-6(config)#
L2-SW-6(config)#do show run | begin spanning-tree
spanning-tree mode pvst
spanning-tree portfast bpduguard default
spanning-tree extend system-id
spanning-tree uplinkfast
spanning-tree backbonefast
!

 
How to Configure Spanning Tree on Cisco Switch in GNS3?

   Step 5

L2-SW-7 Switch Spanning Tree BPDU Guard configuration process;

L2-SW-7#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
L2-SW-7(config)#spanning-tree portfast bpduguard
L2-SW-7(config)#errdisable recovery cause bpduguard
L2-SW-7(config)#errdisable recovery interval 400
L2-SW-7(config)#
L2-SW-7(config)#do show run | begin spanning-tree
spanning-tree mode pvst
spanning-tree portfast bpduguard default
spanning-tree extend system-id
spanning-tree uplinkfast
spanning-tree backbonefast
!

 
How to Configure Spanning Tree on Cisco Switch in GNS3?

Examining to verify Spanning Tree on Cisco Switch in GNS3

After enabling Spanning Tree Protocol features on Cisco Layer 2 Switches using the GNS3 program, perform the following steps to verify Spanning Tree on Cisco Switches in GNS3.

Standard STP Convergence time further accelerate with PortFast, UplinkFast, and BackboneFast features, and this time will be 30 seconds in total.

Rapid Spanning-Tree Protocol combines these three features and the STP Convergence time is almost 1 second.

   Step 1

Start continuous ping operation from VPCS PC1 to VPCS PC5.

How to Configure Spanning Tree on Cisco Switch in GNS3?

   Step 2

Immediately after starting the Ping operation continuously, disconnect the cable between L2-SW-3 and L2-SW-1.

How to Configure Spanning Tree on Cisco Switch in GNS3?

   Step 3

As you can see in the image below, there was a delay of about 30 seconds. To see the debug output on the Cisco Switch L2-SW-3, run the debug spanning-tree events command.

How to Configure Spanning Tree on Cisco Switch in GNS3?

   Step 4

After the cable between L2-SW-1 and L2-SW-3 has removed, the L2-SW-3 debug logs will be generated as follows.

L2-SW-3#
*Sep 27 18:22:50.024: STP: VLAN0001 new root port Gi0/1, cost 3008
*Sep 27 18:22:50.024: STP: VLAN0001 Gi0/0 -> blocking (uplinkfast)
*Sep 27 18:22:50.024: STP[1]: Generating TC trap for port GigabitEthernet0/0
*Sep 27 18:22:50.024: %SPANTREE_FAST-7-PORT_FWD_UPLINK: VLAN0001 GigabitEthernet0/1 moved to Forwarding (UplinkFast).
*Sep 27 18:22:50.024: STP[1]: Generating TC trap for port GigabitEthernet0/1
*Sep 27 18:22:50.024: STP: VLAN0001 sent Topology Change Notice on Gi0/1
*Sep 27 18:22:50.024: STP: VLAN0001 Gi0/0 -> listening
*Sep 27 18:23:05.024: STP: VLAN0001 Gi0/0 -> learning
*Sep 27 18:23:20.024: STP[1]: Generating TC trap for port GigabitEthernet0/0
*Sep 27 18:23:20.024: STP: VLAN0001 sent Topology Change Notice on Gi0/1
*Sep 27 18:23:20.024: STP: VLAN0001 Gi0/0 -> forwarding
L2-SW-3#

 
How to Configure Spanning Tree on Cisco Switch in GNS3?

Show Commands Related to How to Configure Spanning Tree on Cisco Switch in GNS3

Spanning Tree VPCS PC Configuration and Show IP Commands

[su_tabs active=”1″]
[su_tab title=”VPCS PC1″]
PC1> ip 192.168.1.1/24
Checking for duplicate address…
PC1 : 192.168.1.1 255.255.255.0

PC1> show ip

NAME : PC1[1]
IP/MASK : 192.168.1.1/24
GATEWAY : 0.0.0.0
DNS :
MAC : 00:50:79:66:68:01
LPORT : 10092
RHOST:PORT : 127.0.0.1:10093
MTU: : 1500

PC1>
[/su_tab]
[su_tab title=”VPCS PC2″]
PC2> ip 192.168.1.2/24
Checking for duplicate address…
PC1 : 192.168.1.2 255.255.255.0

PC2> show ip

NAME : PC2[1]
IP/MASK : 192.168.1.2/24
GATEWAY : 0.0.0.0
DNS :
MAC : 00:50:79:66:68:00
LPORT : 10088
RHOST:PORT : 127.0.0.1:10089
MTU: : 1500

PC2>
[/su_tab]
[su_tab title=”VPCS PC3″]
PC3> ip 192.168.1.3/24
Checking for duplicate address…
PC1 : 192.168.1.3 255.255.255.0

PC3> show ip

NAME : PC3[1]
IP/MASK : 192.168.1.3/24
GATEWAY : 0.0.0.0
DNS :
MAC : 00:50:79:66:68:02
LPORT : 10090
RHOST:PORT : 127.0.0.1:10091
MTU: : 1500

PC3>
[/su_tab]
[su_tab title=”VPCS PC4″]
PC4> ip 192.168.1.4/24
Checking for duplicate address…
PC1 : 192.168.1.4 255.255.255.0

PC4> show ip

NAME : PC4[1]
IP/MASK : 192.168.1.4/24
GATEWAY : 0.0.0.0
DNS :
MAC : 00:50:79:66:68:03
LPORT : 10094
RHOST:PORT : 127.0.0.1:10095
MTU: : 1500

PC4>
[/su_tab]
[su_tab title=”VPCS PC5″]
PC5> ip 192.168.1.5/24
Checking for duplicate address…
PC1 : 192.168.1.5 255.255.255.0

PC5> show ip

NAME : PC5[1]
IP/MASK : 192.168.1.5/24
GATEWAY : 0.0.0.0
DNS :
MAC : 00:50:79:66:68:04
LPORT : 10096
RHOST:PORT : 127.0.0.1:10097
MTU: : 1500

PC5>
[/su_tab]
[/su_tabs]

Spanning Tree Show Running Command Outputs

[su_tabs active=”1″]
[su_tab title=”L2-SW-1#show running-config”]
L2-SW-1#show running-config
Building configuration…

Current configuration : 4970 bytes
!
! Last configuration change at 18:07:43 UTC Wed Sep 27 2017
!
version 15.0
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
service compress-config
!
hostname L2-SW-1
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
!
!
!
ip cef
no ipv6 cef
!
!
!
spanning-tree mode pvst
spanning-tree portfast bpduguard default
spanning-tree extend system-id
spanning-tree backbonefast
spanning-tree vlan 1 priority 24576
!
vlan internal allocation policy ascending
!
!
!
interface GigabitEthernet0/0
media-type rj45
negotiation auto
!
interface GigabitEthernet0/1
media-type rj45
negotiation auto
!
interface GigabitEthernet0/2
media-type rj45
negotiation auto
!
interface GigabitEthernet0/3
media-type rj45
negotiation auto
!
interface GigabitEthernet1/0
media-type rj45
negotiation auto
!
interface GigabitEthernet1/1
media-type rj45
negotiation auto
!
ip forward-protocol nd
!
no ip http server
no ip http secure-server
!
!
line con 0
line aux 0
line vty 0 4
!
!
end

L2-SW-1#
[/su_tab]
[su_tab title=”L2-SW-2#show running-config”]
L2-SW-2#show running-config
Building configuration…

Current configuration : 4929 bytes
!
! Last configuration change at 18:03:52 UTC Wed Sep 27 2017
!
version 15.0
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
service compress-config
!
hostname L2-SW-2
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
!
!
!
ip cef
no ipv6 cef
!
!
!
spanning-tree mode pvst
spanning-tree extend system-id
spanning-tree backbonefast
spanning-tree vlan 1 priority 28672
!
vlan internal allocation policy ascending
!
!
!
interface GigabitEthernet0/0
media-type rj45
negotiation auto
!
interface GigabitEthernet0/1
media-type rj45
negotiation auto
!
interface GigabitEthernet0/2
media-type rj45
negotiation auto
!
interface GigabitEthernet0/3
media-type rj45
negotiation auto
!
interface GigabitEthernet1/0
media-type rj45
negotiation auto
!
interface GigabitEthernet1/1
media-type rj45
negotiation auto
!
ip forward-protocol nd
!
no ip http server
no ip http secure-server
!
!
line con 0
line aux 0
line vty 0 4
!
!
end

L2-SW-2#
[/su_tab]
[su_tab title=”L2-SW-3#show running-config”]
L2-SW-3#show running-config
Building configuration…

Current configuration : 4920 bytes
!
! Last configuration change at 18:20:38 UTC Wed Sep 27 2017
!
version 15.0
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
service compress-config
!
hostname L2-SW-3
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
!
!
!
ip cef
no ipv6 cef
!
!
errdisable recovery cause bpduguard
errdisable recovery interval 400
!
spanning-tree mode pvst
spanning-tree portfast bpduguard default
spanning-tree extend system-id
spanning-tree uplinkfast
spanning-tree backbonefast
!
vlan internal allocation policy ascending
!
!
!
interface GigabitEthernet0/0
media-type rj45
negotiation auto
!
interface GigabitEthernet0/1
media-type rj45
negotiation auto
!
interface GigabitEthernet0/2
media-type rj45
negotiation auto
!
interface GigabitEthernet0/3
media-type rj45
negotiation auto
spanning-tree portfast
!
ip forward-protocol nd
!
no ip http server
no ip http secure-server
!
!
line con 0
line aux 0
line vty 0 4
!
!
end

L2-SW-3#
[/su_tab]
[su_tab title=”L2-SW-4#show running-config”]
L2-SW-4#show running-config
Building configuration…

Current configuration : 4920 bytes
!
! Last configuration change at 18:21:37 UTC Wed Sep 27 2017
!
version 15.0
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
service compress-config
!
hostname L2-SW-4
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
!
!
ip cef
no ipv6 cef
!
!
errdisable recovery cause bpduguard
errdisable recovery interval 400
!
spanning-tree mode pvst
spanning-tree portfast bpduguard default
spanning-tree extend system-id
spanning-tree uplinkfast
spanning-tree backbonefast
!
vlan internal allocation policy ascending
!
!
!
interface GigabitEthernet0/0
media-type rj45
negotiation auto
!
interface GigabitEthernet0/1
media-type rj45
negotiation auto
!
interface GigabitEthernet0/2
media-type rj45
negotiation auto
!
interface GigabitEthernet0/3
media-type rj45
negotiation auto
spanning-tree portfast
!
ip forward-protocol nd
!
no ip http server
no ip http secure-server
!
!
!
line con 0
line aux 0
line vty 0 4
!
!
end

L2-SW-4#
[/su_tab]
[su_tab title=”L2-SW-5#show running-config”]
L2-SW-5#show running-config
Building configuration…

Current configuration : 4920 bytes
!
! Last configuration change at 18:24:45 UTC Wed Sep 27 2017
!
version 15.0
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
service compress-config
!
hostname L2-SW-5
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
!
!
!
ip cef
no ipv6 cef
!
!
errdisable recovery cause bpduguard
errdisable recovery interval 400
!
spanning-tree mode pvst
spanning-tree portfast bpduguard default
spanning-tree extend system-id
spanning-tree uplinkfast
spanning-tree backbonefast
!
vlan internal allocation policy ascending
!
!
!
interface GigabitEthernet0/0
media-type rj45
negotiation auto
!
interface GigabitEthernet0/1
media-type rj45
negotiation auto
!
interface GigabitEthernet0/2
media-type rj45
negotiation auto
!
interface GigabitEthernet0/3
media-type rj45
negotiation auto
spanning-tree portfast
!
ip forward-protocol nd
!
no ip http server
no ip http secure-server
!
!
!
line con 0
line aux 0
line vty 0 4
!
!
end

L2-SW-5#
[/su_tab]
[su_tab title=”L2-SW-6#show running-config”]
L2-SW-6#show running-config
Building configuration…

Current configuration : 4920 bytes
!
! Last configuration change at 18:25:59 UTC Wed Sep 27 2017
!
version 15.0
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
service compress-config
!
hostname L2-SW-6
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
!
ip cef
no ipv6 cef
!
!
errdisable recovery cause bpduguard
errdisable recovery interval 400
!
spanning-tree mode pvst
spanning-tree portfast bpduguard default
spanning-tree extend system-id
spanning-tree uplinkfast
spanning-tree backbonefast
!
vlan internal allocation policy ascending
!
!
!
interface GigabitEthernet0/0
media-type rj45
negotiation auto
!
interface GigabitEthernet0/1
media-type rj45
negotiation auto
!
interface GigabitEthernet0/2
media-type rj45
negotiation auto
!
interface GigabitEthernet0/3
media-type rj45
negotiation auto
spanning-tree portfast
!
ip forward-protocol nd
!
no ip http server
no ip http secure-server
!
!
!
line con 0
line aux 0
line vty 0 4
!
!
end

L2-SW-6#
[/su_tab]
[su_tab title=”L2-SW-7#show running-config”]
L2-SW-7#show running-config
Building configuration…

Current configuration : 4920 bytes
!
! Last configuration change at 18:29:00 UTC Wed Sep 27 2017
!
version 15.0
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
service compress-config
!
hostname L2-SW-7
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
!
!
!
ip cef
no ipv6 cef
!
!
errdisable recovery cause bpduguard
errdisable recovery interval 400
!
spanning-tree mode pvst
spanning-tree portfast bpduguard default
spanning-tree extend system-id
spanning-tree uplinkfast
spanning-tree backbonefast
!
vlan internal allocation policy ascending
!
!
!
interface GigabitEthernet0/0
media-type rj45
negotiation auto
!
interface GigabitEthernet0/1
media-type rj45
negotiation auto
!
interface GigabitEthernet0/2
media-type rj45
negotiation auto
spanning-tree portfast
!
interface GigabitEthernet0/3
media-type rj45
negotiation auto
!
ip forward-protocol nd
!
no ip http server
no ip http secure-server
!
!
line con 0
line aux 0
line vty 0 4
!
!
end

L2-SW-7#
[/su_tab]
[/su_tabs]

How to Configure Spanning Tree on Cisco Switch in GNS3? ⇒ Video

You can watch how to configure Spanning Tree Protocol on Cisco Switches using GNS3 program and also you can subscribe to our YouTube channel to support us!

  Final Word 

How to Configure Spanning Tree on Cisco Switch in GNS3? – In this article, we performed the steps to configure Spanning Tree on Cisco Switches. After we enabled the STP features in the original (802.1D) Spanning Tree configuration, we did a little verification.

If this article is helpful, send me feedback by commenting! Thanks in advance, take care of yourself!

Also, you can add to browser bookmarks by pressing the CTRL+D to read this article later!

Articles Related to How to Configure Spanning Tree on Cisco Switch in GNS3

[su_box title=”Related Articles” box_color=”#242424″ radius=”0″]
 How to Install Cisco IOU L2 Appliance in GNS3?
♦ How Switch Works? How Does Switch Learn MAC Addresses?
♦ How to Configure Loopback Adapter in GNS3?
♦ How to Configure Port Security on Cisco Switch in GNS3?
♦ How to Configure VLAN in Layer 2 Switch in GNS3?
[/su_box]

Products Related to How to Configure Spanning Tree on Cisco Switch in GNS3

[su_box title=”Related Products” box_color=”#242424″ radius=”0″]

[/su_box]

Add a Comment

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