The Spanning Tree Protocol (STP) is defined by IEEE standard 802.1D-1988. The STP generates a single spanning tree inside a network. Such mode proved to be useful for supporting applications and protocols in which frames are delivered out of sequence or as duplicates.
The topology is named Spanning Tree, because it is constructed as a loop-free active forwarding topology, meaning that it is a tree-type topology that spans the entire network.
The spanning tree is generated during the process of exchanging Bridge Protocol Data Units (BPDUs) between bridges in a LAN. The spanning tree algorithm functions in two following ways:
By default, RSTP is the mode enabled on every port of a switch. It prevents Layer 2 loops in a network.
switch# configure terminal
switch(config)# spanning-tree mode stp
switch(config)# spanning-tree enable
switch(config)# spanning-tree priority <priority>
The Root Guard feature is responsible for verifying if the port on which it was enabled is a designated port. If the port with enabled Root Guard receives a superior BPDU, it goes to a Listening state (for STP) or discarding state (for RSTP and MSTP).
switch(config)# interface <port-list>
switch(config-if)# spanning-tree guard root
switch(config)# end
Display the spanning tree configuration for the device and confirm the new root bridge priority (Bridge Priority):
switch# show spanning-tree [interface <port-list>]
Note that the Bridge ID is in a form like this: 8192xxxxxxxxxxxx, with other IDs following the same pattern. This ID is made up of two parts: 8192 being the devices’ root bridge priority in hexadecimal, and xxxxxxxxxxxx – the devices’ MAC address.
Looking for more manuals on STP? Check the configs below: