SOURCECODEBD.NET

Live Experience

5. IMPLEMENTING SPANNING TREE PROTOCOL

HOW TO IMPLEMENTING SPANNING TREE PROTOCOL
 
Task 1  
  
Configure Switch1 as the VTP Server and the other Switch (SW2) as VTP Client.  
Configure SW1 to be the STP root for VLAN 1. Change the forward delay time such that  
the port transitions from listening to learning state in just 6 seconds instead of the default  
of 15 seconds. Configure ports fa 0/9 and fa 0/11 as dot1q trunks on both the switches.  
  
Switch1   
                                                            
                                                                      
VTP domain NETMETRICS                                                 
VTP mode server                                                       
VTP password CISCO123                                                 
                                                                      
Interface range fa0/9, fa0/11                                         
Switchport trunk encapsulation                                        
Switchport mode trunk                                                  
                                                                      
Spanning-tree vlan 1 root primary  
Spanning-tree vlan 1 forward-time 6  
  
Switch2
 
VTP domain NETMETRICS
VTP mode client
VTP password CISCO123
 
Interface range fa0/9, fa0/11
Switchport trunk encapsulation
Switchport mode trunk
 
Verification:  
 
SW1#show spanning-tree vlan 1
SW1#debug spanning-tree events
 
Task 2   
  
Configure ports fa0/1  - fa0/3 on SW1 to operate in portfast mode.  
  
Switch1  
  
Int range fa0/1 - fa0/3  
Spanning-tree portfast  
  
Verification:  
  
SW1#show spanning-tree interface fa0/1 detail
SW1#debug spanning-tree events
 
Task 3   
  

5. IMPLEMENTING SPANNING TREE PROTOCOL

  
Configure SW1 to quickly switch its root port in the event of an uplink failure. Trunking  
should be configured between the switches.  
  
Switch1  
  
spanning-tree uplinkfast  
  
Verification:  
  
SW1#show spanning-tree vlan 1
 
The output displays cost of ports increased by 3000 & priority of the bridge has increased to 49152.  
    
Verify the transition from blocking to forwarding :  
      •    Shutdown the port fa0/9 which is in the forwarding state.  
  
SW1#debug spanning-tree uplinkfast  
 
Task 4  
 

5. IMPLEMENTING SPANNING TREE PROTOCOL_T4

 
Configure portfast on port fa 0/9 between SW1 and SW2. (By default all ports on the  
switch are in dynamic desirable mode, they autonegotiate to become trunk. Portfast  
should not be enabled on trunk as there is a possibility of loops, we need to shutdown the  
port fa 0/9 and enable portfast on both the switches on port fa 0/9). Enable BPDU guard  
on port fa 0/9 of SW1 to stop BPDU’s on that port.  
  
Switch1                                                             
                                                                     
Int fa 0/9                                                           
Shutdown                                                              
Spanning-tree portfast                                                
Spanning-tree bpdu guard enable        
 
Switch2 
 
Int fa 0/9  
Shutdown
Spanning-tree portfast  
 
Now bring the port fa 0/9 on both switches to up. As soon as the BPDU’s are being sent  
on the port . The port enabled with BPDU guard will immediately come into err-disable  
state .  
  
Verification:  
  
Console messages on SW1 when the bpdu’s are received on the bpduguard enabled  port  
fa0/9  
 
SW1#show interfaces fa0/9
 
Task 5
 

5. IMPLEMENTING SPANNING TREE PROTOCOL_T5

 
Configure R1 to send BPDUs to SW 1. Enable BPDU guard on port fa0/3 on sw1 to  
block the access port fa 0/3 on SW 1, if any BPDUs received.
 
R1                                                                  
                                                                    
Int e0/0                                                            
No ip address                                                       
Bridge-group 1                                                      
  
Bridge 1 protocol ieee  
Bridge 1 priority 4096   
 
Switch1
 
Int fa0/3
Spanning-tree bpduguard enable
 
Verification:  
  
SW1#show interfaces fa0/3  
 
The output displays that as soon as BPDU received on port fa0/3, it is disabled because of  
the BPDU guard enabled on that port.
 
Task 6  
 

5. IMPLEMENTING SPANNING TREE PROTOCOL_T5

 
Configure portfast on port fa0/3 on sw1. Enable BPDU filter on port fa0/3 on sw1.  
Configure R1 to send BPDUs to port fa0/3 on sw1.
 
R1                                                                   
                                                                     
Int e0/0                                                             
No shutdown                                                          
No ip address                                                        
Bridge-group 1                                                      
                                                                     
Bridge 1 protocol ieee                                               
Bridge 1 priority 4096   
  
Switch1
 
Int fa0/3
Switchport mode access
Spanning-tree portfast
Spanning-tree bpduguard enable 
 
Verification:  
  
SW1#show spanning-tree interface fa0/3 detail 
 
The output displays BPDU filter enabled and no BPDU’s sent or received 
 
Task 7 
 

5. IMPLEMENTING SPANNING TREE PROTOCOL_T7

 
Configure SW1 to be the root for VLAN 1. Configure root guard feature on SW1 port  
fa0/9, fa0/11.  
  
Switch1  
  
Spanning-tree vlan 1 root primary  
Int range fa0/9, fa0/11  
No shutdown  
Spanning-tree guard root  
  
 
Verification:  
  
SW1#show spanning-tree interface fa0/9 detail
 
The output displays root guard enabled on port.  
Now change the priority in SW2:  
  
Switch2  
  
Spanning-tree vlan 1 priority 4096  
  
As root guard is enabled on SW1, the ports on SW1 change to root inconsistent ports,  
thus blocking the port when superior BPDUs are received on SW1.  
  
SW1#show spanning-tree interface fa0/9 detail 
 
SW1#debug spanning-tree events
 
The output displays that root guard blocking port fa0/9  
  
SW1#show spanning-tree vlan 1 
 
The output displays that the ports fa0/9 & fa0/11 are in “BKN” state as root-inconsistent type.  
  
SW1#show spanning-tree inconsistentports 
 
The output displays both fa 0/9 and fa 0/11 as inconsistent ports.  
  
Task 8  
 

5. IMPLEMENTING SPANNING TREE PROTOCOL_T7

 
Configure SW1 to the root bridge for vlan1. Configure loop guard on SW2, i.e., on the  
switch that is not the root bridge. Configure ports fa0/9 & fa0/11 between SW1 and SW2  
as trunk ports.  
 
 
Switch1                                                             
                                                                    
Int range fa0/9 , fa0/11                                            
Switchport trunk encapsulation dot1q                                
Switchport mode trunk                                               
Spanning-tree vlan 1 root primary                                   
       
                                                                    
Switch2
 
Int range fa0/9 , fa0/11
Switchport trunk encapsulation dot1q
Switchport mode trunk
Spanning-tree guard loop
   
  
Verification:  
  
SW2#show spanning-tree interface fastEthernet 0/9 detail
 
The output displays that loop guard is enabled on the port.  
  
Now filter BPDU’s on port fa 0/9 on SW1 :  
  
Switch1  
  
Int fa0/9  
Spanning-tree bpdufilter enable  
  
BPDU’s will be stopped on SW1 and the port changes to loop inconsistent.  
  
SW2#show spanning-tree interface fa0/9 detail
 
The loop inconsistent state indicates that the port is not receiving any BPDU’s or not  
sending any BPDU’s through the port.  
  
SW2#show spanning-tree inconsistentports

 

You are here: Home / Switching / HOW TO IMPLEMENTING SPANNING TREE PROTOCOL