How to Use Root Primary Command in Spanning Tree in GNS3

When we configure the Spanning Tree Protocol on Cisco Switches, we usually use the spanning-tree vlan priority command when selecting Root Bridge Switch.

How to Use Root Primary Command in Spanning Tree in GNS3

How to Configure Root Primary in Cisco Switch

The Spanning Tree Protocol (802.1D) was developed to prevent loops from Layer 2 Cisco Switches operating on the OSI layer 2. We can manually select Root Bridge on Cisco Switches with standard STP protocol or Rapid Spanning Tree Protocol enabled.

There are two methods to select a Manual Root Bridge Switch. The first method is to change the Priority value of the Switch. The second method is to use and configure the Root Primary command.

When Root Bridge is selected using the Root Primary command on Cisco Switches, the Priority values ​​of the Switches are automatically adjusted.

How to Select Root Bridge in Cisco Switch

Using the GNS3 program, configure Cisco Layer 2 Switches on a small network topology with Primary/Secondary commands.

   Step 1

Open the GNS3 program, and create a new project as shown in the image below. And then, add Layer 2 Switches to GNS3 workspace as shown below.

GNS3 Network Topology

   Step 2

Specify the Cisco Switch to select Root Bridge, and then define the Switch closest to the Root Bridge as Secondary Root Bridge. Then run all Layer 2 Switches in the GNS3 workspace and open the CLI command prompt windows.

Root and Secondary Bridge Configuration

   Step 3

Priority values ​​are 32769 when Cisco Switches first add to the network. Therefore, you can change the Priority values ​​manually or automatically.

To select Root Bridge with this command on Cisco Switches you have specified in GNS3, perform the following command at the CLI prompt of the L2-SW-1 Switch in the network topology, and then examine the  show spanning-tree output.

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

L2-SW-1#show spanning-tree 

VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    24577
             Address     00b4.349f.fe00
             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     00b4.349f.fe00
             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 LIS 4         128.2    Shr 
Gi0/2               Desg FWD 4         128.3    Shr 
Gi0/3               Desg FWD 4         128.4    Shr 


L2-SW-1#

 
spanning-tree vlan 1 root primary

After selecting Root Bridge, you can see that the Priority value of the L2-SW-1 Switch set.

   Step 4

Use the following command to select Cisco Switch L2-SW-2 as the second root bridge, and check the Priority value with the show spanning-tree command.

L2-SW-2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
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     00b4.349f.fe00
             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     00b4.3451.da00
             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/2               Desg FWD 4         128.3    Shr 
Gi0/3               Desg FWD 4         128.4    Shr 


L2-SW-2#

 
spanning-tree vlan 1 root secondary

We have configured Cisco Switch L2-SW-2 as a Secondary Root Bridge. If you remove the L2-SW-1 Switch over the network, the Root Bridge will be the L2-SW-2 Switch.

   Step 5

You can see that the Priority values ​​change automatically in the Cisco Switch L2-SW-1 and L2-SW-2 show running-config command output.

show running-config

Show Commands


L2-SW-1#show running-config
Building configuration...

Current configuration : 4770 bytes
!
! Last configuration change at 07:49:43 UTC Mon Sep 25 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 extend system-id
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
!
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#

 


L2-SW-2#show running-config
Building configuration...

Current configuration : 4770 bytes
!
! Last configuration change at 07:50:32 UTC Mon Sep 25 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 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
!
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#

 


L2-SW-3#show spanning-tree

VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 24577
Address 00b4.349f.fe00
Cost 4
Port 3 (GigabitEthernet0/2)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)
Address 00b4.3453.4900
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 Desg FWD 4 128.1 Shr
Gi0/1 Desg FWD 4 128.2 Shr
Gi0/2 Root FWD 4 128.3 Shr
Gi0/3 Altn BLK 4 128.4 Shr

L2-SW-3#

 


L2-SW-4#show spanning-tree

VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 24577
Address 00b4.349f.fe00
Cost 4
Port 3 (GigabitEthernet0/2)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)
Address 00b4.3497.7d00
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 Desg FWD 4 128.1 Shr
Gi0/1 Altn BLK 4 128.2 Shr
Gi0/2 Root FWD 4 128.3 Shr
Gi0/3 Desg FWD 4 128.4 Shr

L2-SW-4#

 

How to Choose Root Bridge ⇒ Video

You can watch the video below to use Cisco Root Primary/Secondary commands on Layer 2 Switches and subscribe to our YouTube channel to support us!

   Final Word


In this article, we have manually selected Root Bridge and Secondary Bridge using GNS3 Root Primary. Thanks for following us!

   Related Articles


How to Configure Cloud in GNS3
♦ How to Import GNS3 VM
How Does Switch Learn MAC Addresses?
How to Configure Port Security in GNS3
How to Configure VLAN in GNS3

Add a Comment

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

shares
error: