what will happen if a portfast port receives BPDUs
Question:
what will happen if a switch port enabled with portfast receives BPDUs.
suggestions- portfast will be disabled OR port will come to forward state by passing listening and learning state.
Does it depend on IOS versions.
I am using 3550(c3550-i5q3l2-mz.121-22.EA9.bin) and WS-C3750X-24T-L (c3750-ipservicesk9-mz.122-50.SE3.bin) series switches.
If it depend on versions, what versions should i use for my 3550 and 3750 switches.
Answer:
If a Portfast enabled port receives BPDUs it will lose its Portfast status, regardless if configured on interface or globally.
If it has the command on it and you shut/no shut then I assume that any state is lost and it would do what the config says which is to bring the port into forwarding immediately.
When I test it moves straight to forwarding at first:
Starting spanning tree: VLAN0001 (3260860)
set portid: VLAN0001 Fa0/13: new port id 800F
Created spanning tree port Fa0/13 (327005C) for tree VLAN0001 (3260860)
Enabling spanning tree port: FastEthernet0/13 (327005C)
STP: VLAN0001 Fa0/13 ->jump to forwarding from blocking
%LINK-3-UPDOWN: Interface FastEthernet0/13, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/13, changed state to up
SW2(config-if)#no span bpdufilter enable
STP: VLAN0001 Topology Change rcvd on Fa0/13
STP: VLAN0001 Topology Change rcvd on Fa0/13
SW1(config-if)#do sh span int f0/13 portfast
VLAN0001 disabled
SW1(config-if)#do sh span int f0/13
Vlan Role Sts Cost Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
VLAN0001 Desg FWD 19 128.15 P2p
Portfast is disabled but the port remains in forwarding. This is normal. Now let's see what happens if we shut/no shut.
Disabling spanning tree port: FastEthernet0/13 (327005C)
Deleting spanning tree port: Fa0/13 (327005C)
STP PVST: deleted vlan 1 intf 3B05F68
Deleting spanning tree: VLAN0001 (3260860)
Created spanning tree: VLAN0001 (313E698)
Setting spanning tree MAC address: VLAN0001 (313E698) to 001b.d490.7980
setting bridge id (which=3) prio 16385 prio cfg 16384 sysid 1 (on) id 4001.001b.d490.7980
STP PVST: Assigned bridge address of 001b.d490.7980 for VLAN0001 [1] @ 313E698.
Enabling spanning tree optimized bpdu tx for VLAN0001 (313E698)
Starting spanning tree: VLAN0001 (313E698)
set portid: VLAN0001 Fa0/13: new port id 800F
Created spanning tree port Fa0/13 (327005C) for tree VLAN0001 (313E698)
Enabling spanning tree port: FastEthernet0/13 (327005C)
STP: VLAN0001 Fa0/13 ->jump to forwarding from blocking
If we do a shut/no shut and look at the stats fast we see:
SW1(config-if)#sh
SW1(config-if)#no sh
SW1(config-if)#do show span int f0/13 det
Port 15 (FastEthernet0/13) of VLAN0001 is designated forwarding
Port path cost 19, Port priority 128, Port Identifier 128.15.
Designated root has priority 16385, address 001b.d490.7980
Designated bridge has priority 16385, address 001b.d490.7980
Designated port id is 128.15, designated path cost 0 Hello is pending, Topology change is set
Timers: message age 0, forward delay 0, hold 0
Number of transitions to forwarding state: 1
Link type is point-to-point by default
BPDU: sent 1, received 2
You can see that the counters for BPDUs have been cleared.
So essentially what happens is that when we shut all STP information that was cached on the port is deleted. Including BPDUs and stats for BPDUs. So when the port initializes, STP initalizes again, BPDUs are sent and so on. The port must adhere to the configuration on the port which is Portfast and the port moves immediately to forwarding.