A common misunderstanding among Cisco students is that portfast disables spanning-tree on a certain interface. This is not correct however…if you enable portfast on an interface then it will jump to the forwarding state of spanning-tree. We still run spanning-tree on the interface!
To prove this, let me give you an example. We’ll use two switches for this:
Above we have a simple topology with two switches. Let’s configure FastEthernet0/24 on SW1 as an access port and enable portfast on it.
SW1(config)#interface fa0/24 SW1(config-if)#shutdown SW1(config-if)#switchport mode access SW1(config-if)#spanning-tree portfast
Now before I ‘no shut’ the interface we’ll enable a spanning-tree debug:
SW1#debug spanning-tree events Spanning Tree event debugging is on
Now let’s see what will happen when the interface comes up:
SW1(config)#interface fa0/24 SW1(config-if)#no shutdown
On your console you will see that the interfaces goes to forwarding mode immediately:
SW1# STP: VLAN0001 Fa0/24 ->jump to forwarding from blocking
Let’s take a look at the output of show spanning-tree:
SW1#show spanning-tree vlan 1 VLAN0001 Spanning tree enabled protocol ieee Root ID Priority 32769 Address 0011.bb0b.3600 This bridge is the root Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32769 (priority 32768 sys-id-ext 1) Address 0011.bb0b.3600 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 300 sec Interface Role Sts Cost Prio.Nbr Type ------------------- ---- --- --------- -------- -------------------------------- Fa0/24 Desg FWD 19 128.26 P2p Edge
SW1 is our root bridge and you can see that FastEthernet 0/24 has portfast enabled because of the p2p Edge type. The portfast enabled interface is still sending BPDUs, you can verify it using the following command:
SW1#show spanning-tree interface FastEthernet 0/24 detail Port 26 (FastEthernet0/24) of VLAN0001 is designated forwarding Port path cost 19, Port priority 128, Port Identifier 128.26. Designated root has priority 32769, address 0011.bb0b.3600 Designated bridge has priority 32769, address 0011.bb0b.3600 Designated port id is 128.26, designated path cost 0 Timers: message age 0, forward delay 0, hold 0 Number of transitions to forwarding state: 1 The port is in the portfast mode Link type is point-to-point by default BPDU: sent 74, received 0
If you use this command a couple of times you will see that the number of BPDUs sent will increase.
Let’s make SW2 the root bridge so we can see if SW1 processes incoming BPDUs:
SW2(config)#spanning-tree vlan 1 root primary
This is what you will find on SW1 now: