Since spanning tree takes 30 seconds to converge it is a very long time and it could cause some services to time out, like DHCP. By enabling PortFast it alleviates this problem. Careful consideration should be taken when enabling this command as it creates the potential for loops.
R2(config-if)# no spanning-tree portfast
Bridge Protocol Data Unit (BPDU) is a message sent out by switches to identify potential loops in the network. PortFast enabled ports should not receive BPDU’s because this will cause a bridging loop to occur.
R2(config-if)#spanning-tree bpduguard enable
This command is for Access layer switches. When the designated port comes down there is around 45 seconds downtime while the port is in listening and learning state and thereafter onto a forwarding state.
This command allows blocked ports to bypass listening and learning states when a designated port comes down. The downtime would be 5 seconds or less.
R2(config-if)# spanning-tree uplinkfast
Some SHOW Commands
R2#sh spanning-tree summary
R2#sh spanning-tree vlan 1