Applying port specific commands in your configuration will reduce port initialization time in the event that the switch or the connected device power cycle, reboot or reload. They may also prevent misapplied configuration settings in the event the port does not properly negotiate.
As the default for Cisco switches is switchport mode dynamic desirable (Cisco Stackwise capable switches are the exception) every port attempts to negotiate its intended purpose. This negotiation process has four major phases and may take a full minute to complete.
- Spanning Tree Protocol (STP) initialization – the port goes through
the five phases of STP: blocking, listening, learning, forwarding,
and disabled.
- Testing for Ether Channel configuration – port uses the Port
Aggregation Protocol (PAgP), bonding together of switch ports to
create larger aggregate Ethernet connections.
- Testing for trunk configuration – ports uses Dynamic Trunk Protocol
(DTP) to negotiate/validate a trunk link.
- Switch port speed and duplex – port uses Fast Link Pulses (FLP) to
set speed and duplex. Failure to negotiate duplex Cisco switches use
a default duplex setting of half duplex (HDX) (for 10-Mbps and
100-Mbps interfaces) or full duplex (FDX) (for 1000-Mbps interfaces).
Configuring switchport mode access will prevent the port from going through trunk negotiation.
Configuring spanning-tree portfast will prevent the port from going through STP negotiation.
Configuring switchport host will configure both access and portfast..
Of course the caveat from Cisco - Caution: Never use the PortFast feature on switch ports that connect to other switches, hubs, or routers. These connections can cause physical loops, and spanning tree must go through the full initialization procedure in these situations. A spanning tree loop can bring your network down. If you turn on PortFast for a port that is part of a physical loop, there can be a window of time when packets are continuously forwarded (and can even multiply) in such a way that the network cannot recover.