Wednesday, November 19, 2008

Fix Switchport Delays with Spanning-tree Port Fast Command

Recently, I was engaged to assess a client's network and plugged my laptop into a switch port in their boardroom. After a couple of minutes, I finally got an IP address. I was surprised to learn that spanning-tree portfast was not enabled on any of the switch ports.

According to Cisco's reference guide:
"When the Port Fast feature is enabled, the interface changes directly from a blocking state to a forwarding state without making the intermediate spanning-tree state changes."
This basically means that the switch port automatically assumes a workstation will be attached, instead of another switch. Sounds great, huh? Everybody gets an immediate link light and an IP address.

Well, if a switch is attached to this port, it could create a topology loop and cause a data packet loop resulting in a network melt-down. But, another feature prevents the network melt-down worst case scenario, BPDU filter and guard.

BPDU is part of the Spanning-tree protocol. To learn more about BPDU, and Spanning-tree, visit Wikipedia -, or this Cisco link -

BPDU filter
prevents the switch interface connected to end stations from sending or receiving BPDUs.

BPDU guard will place the interface that receives BPDUs into an error-disabled state. This prevents the possibility of creating a layer 2 loop.

So, let's get to the commands.

First, to activate the
spanning-tree portfast feature, there is a couple of ways to do it:
  1. On a per port basis, the command is spanning-tree portfast.
  2. On a global switch basis, the command is spanning-tree portfast default.
The default keyword on the end of the command activates portfast on all nontrunking interfaces.

Second, to activate BPDU filter in a global configuration mode, the command is
spanning-tree portfast bpdufilter default.

Third, to activate BPDU guard in a global configuration mode, the command is spanning-tree portfast bpduguard default.

Next time, we will discuss a macro command that activates spanning-tree portfast and a couple of other features that should be used on each switch access port.

No comments: