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 go 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 several 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:
Hi Rene,
I realized when you show
SW1#show spanning-tree interface FastEthernet 0/24 detail
q1) The “bpdu receive” is 0 - why ? ( non-root bridges do not send bpdu to root bridge ?)
q2) What is the difference between “P2P Edge” and “P2P” ? What do that actually meant ?
q3) Do we use portfast on ports that we are sure will not cause a loop ?
Regards,
Alan
Hi Alan,
Rene
Hi all,
... Continue reading in our forumi have a port in access but from the output i see that port is in blocking:
Hello Valero
Spanning Tree doesn’t only apply to trunk ports, but is also active on access ports as well. So it is perfectly normal to see access ports in the blocking state. This is the case even if you’re using portfast, as shown in the lesson.
In this particular case, GigabitEthernet5/0/47 is actually a backup blocking port. This is a port state that we see when we use Rapid Spanning Tree. A backup blocking port will be used when there are two or more physical links between two switches. More about the backup port state can be seen at the following less
... Continue reading in our forumHi, if portfast doesn’t disable spanning-tree we should always see BPDU’s on this interface.
Even when we connect an unmanaged switch to an access port ?
Do we need a BPDUGuard in order to block the port when a BPDU is received or does spanning-tree still do its job and block the port in case of a loop ?
Thanks,
Oliver