Switch(config)# int fa0/21
Switch(config-if)# switchport mode access
Switch(config-if)# spanning-tree portfast
%Warning: Only enable PortFast on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc. to this
interface when you've PortFast can cause temporary bridging loops.
Use with CAUTION.
%This has configured PortFast on FastEthernet0/21 but will only
have an effect when the interface is in a non-trunking mode.
Switch(config-if)# no shutdown
Switch(config-if)#
也可以在一系列端口上设置,比如:
Switch(config)# int range fastEthernet 0/1 - 24
Switch(config-if-range)# switchport mode access
Switch(config-if-range)# spanning-tree portfast