Improving dhclient startup time

David W. Hankins David_Hankins at
Thu Jun 15 16:41:20 UTC 2006

On Thu, Jun 15, 2006 at 03:52:15PM +0200, Lorenzo Colitti wrote:
> Hi,
> recently I've been investigating why it takes my laptop such a long time 
> to get an Internet connection using NetworkManager (~15 seconds). After 
> hacking on NetworkManager to speed this up, I discovered that dhclient 
> has a random 0-4 second wait before sending the first DHCPDISCOVER out:

Also look in your /etc/dhclient.conf.  I've found on one networkmanagered
Linux (SuSe 10.1, anyway) that dhclient.conf has:

	select-timeout 5;

So, once it gets an OFFER, it waits 5 seconds in the hopes a better
OFFER will come along.

In practice, most people don't use this option (and neither does
Windows or Mac OSX use a similar device), but if you do wish to use it
I'd suggest a value of no higher than 2, and I myself tend ot use the
value 1.

The rest of the delay from networkmanager is probably trying to figure
out which network to use before dhclient is invoked.

> I've tried this and it seems to work fine (and it's much faster of 
> course). Does this make sense?

As Ted says, I'd pull it entirely, not just if there's only one
interface.  Not only as he says does no one else do this, but the
amount of time it takes different machines to boot already acts as
enough of a random dispersion of the client requests.

So, instead of going through the timeout, just call state_reboot(client)

David W. Hankins		"If you don't do it right the first time,
Software Engineer			you'll just have to do it again."
Internet Systems Consortium, Inc.		-- Jack T. Hankins

More information about the dhcp-users mailing list