Jeremy’s IT Lab lecture video:

Day 21 - Spanning Tree Protocol (STP) (2)


Commands


Classic Spanning Tree Information

The protocol version identifier for classic STP is 0

Spanning Tree Port States

Classic Spanning Tree has 5 different port states, being:

  1. Blocking / Stable
  2. Listening / Transitional
  3. Learning / Transitional
  4. Forwarding / Stable
  5. Disabled

A forwarding interface can move directly into a blocking,

However, a blocking cannot move directly into a forwarding state. It must go through the listening and learning states first.


Spanning Tree Timers

There are 3 different spanning tree timers, being:

  1. Hello / 2 seconds
  2. Forward delay / 15 seconds
  3. Max age / 20 seconds (10 multiplied by hello timer)

BPDU forwarding

Switches do not forward the BPDUs out of their root ports and non-designated ports, only their designated ports.


Spanning Tree Optional Features (STP Toolkit)

  1. Portfast
    • Portfast allows a port to move immediately into the forwarding state, bypassing listening and learning. This is used for switchports which are connected to end hosts, as they do not pose a risk to causing loops in the network.
    • Portfast will only work on access ports.
  2. BPDU Guard
    • BPDU Guard makes it so when an interface with BPDU Guard enabled receives a BPDU from another switch, the interface will be shut down to prevent a loop from forming.
  3. Root Guard
    • If you enable root guard on an interface, even if it receives a superior BPDU (lower bridge ID) on that interface, the switch will not accept the new switch as the root bridge. The interface will be disabled.
  4. Loop Guard
    • If you enable loop guard on an interface, even if the interface stops receiving BPDUs, it will not start forwarding. The interface will be disabled.

Spanning Tree Primary and Secondary Root Bridges

There are two commands to easily change the bridge priority of a switch, they are:

  1. spanning-tree vlan vlan-id root primary
    • The command sets the STP priority to 24576.
    • If another switch already has a priority lower than 24576, it sets this switch’s priority to 4096 less than the other switch’s priority.
  2. spanning-tree vlan vlan-id root secondary
    • The command sets the STP priority to 28672.

Spanning Tree Port Settings

There are two commands you need to know for spanning tree port settings, they are:

  1. spanning-tree vlan vlan-id cost number
    • Changes an interface’s root cost, therefore overriding the default STP port costs.
  2. spanning-tree vlan vlan-id port-priority number
    • Changes an interface’s port priority, therefore overriding the default STP port priority of 128.