Speeding Up Ports for Hosts That Need DHCP Configuration

Posted by Tres Tue, 04 Jul 2006 01:55:00 GMT

I’ve found that sometimes, especially with newer NICs on older switches, the host’s DHCP client times out before the port initialization completes. The switch flashes an orange light while the DHCP client keeps trying to send advertisements. This isn’t so bad when you’re just trying to get a DHCP address, most modern operating systems will eventually keep trying until they get one. This really gets frustrating when you’re trying to use BOOTP for PXE booting. You can’t do the install because the system never gets an IP address.

To me this seemed like some kind of port speed or duplex negotiation problem. But even when I turned off auto-negotiation and set all port speed and duplex parameters manually, it still didn’t fix the problem. That’s because the problem isn’t port negotiation, it’s STP (Spanning Tree Protocol).

STP is what Cisco uses to allow for redundant pathways between switches. STP will put a switchport into one of two normal operating states: forwarding or blocking. Because any switchport could potentially cause a loop if the port were suddenly switched from the blocking state to forwarding state, STP uses two other intermediate states to ensure that a loop will not occur: listening and learning.

In the listening state, the port ensures that there doesn’t already exist a better pathway. In learning state, the switch learns MAC addresses for connected devices without allowing a loop to occur. Once the switchport has passed through these two modes, then it will finally be in the forwarding state, where it will forward DHCP broadcasts.

So, to make a long story short, in order to get switchports up and running quickly, use:

spanning-tree portfast

when configuring ports.

For the most part, this is safe to use, but if it gets set up on an uplink port to another layer 2 device, it can cause loops – things will stop working in a hurry. So like IOS says, “Use with CAUTION.”

Posted in  | Tags , , ,  | no comments