Scenario 4-4: Configuring Spanning Tree PortFast

Spanning tree PortFast is a Cisco enhancement to STP used to allow ports attached to end devices to transition from a Blocked or Disabled state to the Forwarding state, allowing devices to begin sending and receiving data immediately. PortFast is especially useful for ports that are connected to devices that shut down frequently. When you turn on such a device, the switch blocks the port for 30 seconds while the Listening and Learning phases occur. This blocking could cause problems if the device is quick to boot and tries to use the network (e.g., to get a DHCP address or to log on to the network). Enabling PortFast on a port eliminates this problem, because the port immediately begins forwarding traffic as soon as it is initialized.

Before configuring PortFast, you must carefully consider which ports you are going to enable it for. It is recommended that you enable it only for ports that are connected to workstations, because it is very unlikely attaching these devices introduces loops in the network. Do not configure PortFast on ports that connect to other Layer 2 devices, such as a hub, bridge, or switch, and do not configure the feature on ports attached to servers and routers, because these devices are normally up at all times. If you do enable PortFast on a port that is attached to another switch and a loop is detected, the switch immediately blocks the port; however, there is a danger that it could be too late because the switch might already be overwhelmed by a broadcast storm. For this reason, PortFast should only ever be used on ports that are connected to a single host, because this ensures a loop could never be formed.

Configuring PortFast

Figure 4-26 shows a topology where diskless workstations are connected to Switch-C and Switch-D, which boot from the network within a few seconds after powering up. A switch port takes 30 seconds (by default) to start forwarding traffic after initialization; this delay will cause problems for the diskless workstations, which must have network connectivity immediately. The solution to resolve this problem is to enable PortFast on the ports connected to the diskless workstations.

04fig26.gif

Figure 4-26 PortFast Topology

To configure PortFast on Switch-C (Cisco IOS), you use the following interface configuration command:

spanning-tree portfast

Example 4-38 demonstrates the configuration required on Switch-C to enable PortFast on interfaces Fa0/3 through Fa0/24.

Example 4-38. Configuring PortFast on Switch-C

Switch-C# configure terminal
Switch-C(config)# interface range fa0/3 - 24
Switch-C(config-if-range)# spanning-tree portfast
%Warning: portfast should only be enabled on ports connected to a single
 host. Connecting hubs, concentrators, switches, bridges, etc... to this
 interface  when portfast is enabled, can cause temporary bridging loops.
 Use with CAUTION

%Portfast has been configured on FastEthernet0/2 but will only
 have effect when the interface is in a non-trunking mode.

To verify your PortFast configuration on Cisco IOS, you can use the show spanning-tree interface interface detail command, as shown in Example 4-39.

Example 4-39. Verifying PortFast on Switch-C

Switch-C# show spanning-tree interface fa0/3 detail
Port 3 (FastEthernet0/3) of VLAN0001 is forwarding
   Port path cost 19, Port priority 128, Port Identifier 128.2.
   Designated root has priority 8192, address 0001.96a0.2c00
   Designated bridge has priority 28673, address 0009.b7aa.9c80
   Designated port id is 128.2, designated path cost 19
   Timers: message age 0, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   BPDU: sent 70, received 2
   The port is in the portfast mode
   Root guard is enabled

To configure PortFast on Switch-D (CatOS), you use the following command:

set spantree portfast mod/port {enable | disable}

Example 4-40 demonstrates the configuration required on Switch-D to enable PortFast on ports 2/3 through 2/48.

Example 4-40. Configuring PortFast on Switch-D

Switch-D> (enable) set spantree portfast 2/3-48 enable
Warning:Connecting Layer 2 devices to a fast start port can cause
temporary spanning tree loops. Use with caution.

Spantree ports 2/3-48 fast start enabled.

To verify your PortFast configuration, you can use the show spantree module/port command, which displays the PortFast state for the port, as shown in Example 4-41.

Example 4-41. Verifying PortFast on Switch-D

Switch-D> (enable) show spantree 2/3
Port                     Vlan Port-State    Cost      Prio Portfast Channel_id
------------------------ ---- ------------- --------- ---- -------- ----------
 2/3                     1    forwarding          100   32 enabled  0

In Example 4-41, you can see that PortFast (represented by the PortFast column) is enabled for port 2/3 on Switch-D.

+ Share This