How to enable or disable Spanning Tree Protocol (STP)
Spanning Tree Protocol (STP) is enabled by default on modern switches. It is possible to disable or enable the Spanning Tree Protocol (STP) when required.
To enable Spanning Tree Protocol (STP) on an IOS based switch, use the "spanning-tree vlan vlan_number" command from global configuration mode as shown below.
omnisecu.com.switch01>
omnisecu.com.switch01>enable
omnisecu.com.switch01#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
omnisecu.com.switch01(config)#spanning-tree vlan 1
omnisecu.com.switch01(config)#exit
omnisecu.com.switch01#
To disable Spanning Tree Protocol (STP) on an IOS based switch use "no spanning-tree vlan vlan_number" command from global configuration mode as shown below.
Note: Never disable Spanning Tree Protocol (STP) if there is no valid reason to disable it. Disabling Spanning Tree Protocol (STP) can cause Broadcast Storms and Layer 2 Switching Loops, which can make your network down within a short span of time. Use with extreme care.
omnisecu.com.switch01>enable
omnisecu.com.switch01#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
omnisecu.com.switch01(config)#no spanning-tree vlan 1
omnisecu.com.switch01(config)#exit
omnisecu.com.switch01#