Lessons · Network switches · portfast
Thirty seconds of nothing, on every desk
Spanning tree holds a new port in listening and learning before forwarding; portfast skips that on a port with a single device on it.
Hone is a place to practise programming. This is one of its lessons, written out in full and free to read without an account.
What it is for
Without it a PC that boots faster than the port comes up gets no DHCP address and lands on a link-local one, and the user reports it as the network being broken.
How to think about it
Portfast on access ports with one host, never on a port going to another switch. The warning the switch prints when you type it says exactly that, and it is worth reading every time.
Worked example
enableThe # prompt.
configure terminalInto configuration mode.
interface gi0/4A desk port.
switchport mode accessAccess mode first, because portfast on a trunk is the mistake the warning is about.
spanning-tree portfastThe switch prints a warning about hubs and switches. It is not an error; it is the condition under which this is safe.
endOut.
show running-configThe line is under the interface, so it is per port and not a global switch setting.
Your turn
Let this desk port start forwarding immediately.
spanning-tree
Console into a switch
The trap
Turning it on everywhere to fix slow ports. On a port that reaches another switch it removes the delay that stops a loop forming, which trades a thirty second wait for an outage.