Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am running Ubuntu 11.10 32bit Server on a single-board computer. I want the option of using the Ethernet interface (eth0) as a backend to control the computer if it's connected. I'm also lazy: if the cable is plugged in and I power the computer, I want eth0 up and running; in the event no cable is plugged in to eth0 upon powerup, I would like to be able to significantly reduce time it takes to bring eth0 `up' during boot.

I had thought that simply changing the DHCP timeout value to something small would do the job, but even after editing the /etc/dhcp/dhclient.conf, I still get the same long boot times when the cable is unplugged.

I understand the value of a robust bootup sequence for servers (see top answer for [1]), but I don't understand why changes to dhclient.conf are ignored during boot. Is there anything else going on under the hood that I'm not aware of? Perhaps I'm approaching the problem the wrong way (in which case I might need to ask a different question!)?

Thanks in advance for any input.

My /etc/network/interfaces file contains:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto wlan0
iface wlan0 inet static
...

My /etc/dhcp/dhclient.conf file has uncommented and changed the line:

timeout 5;

[1] "Waiting for network configuration" adding 3 to 5 minutes to boot time

share|improve this question
add comment

1 Answer 1

Why are you using auto instead of allow-hotplug? If you use allow-hotplug and your hardware supports link detection, then your system will not even try doing DHCP if there is no link detected.

Another value you may want to look at changing is in the /etc/default/ifupdown file. Consider setting the IFUPDOWN_TIMEOUT timeout.

share|improve this answer
    
I did consider using allow-hotplug, but eth0 does not come up automatically when the cable is plugged in. It is unclear if plugging/unplugging an Ethernet cable is considered a hotplug event (as opposed to adding/removing a wireless USB dongle, which is). My reference, which might be a tad dated, is: lists.debian.org/debian-doc/2008/02/msg00010.html –  Jeffrey Wildman Feb 22 '12 at 14:51
    
I am trying your /e/d/ifupdown suggestion, but the file wasn't initially present and I can't find documentation mentioning the file or the variable IFUPDOWN_TIMEOUT. Creating /e/d/ifupdown and adding 'IFUPDOWN_TIMEOUT = 5' doesn't seem to work. –  Jeffrey Wildman Feb 22 '12 at 15:18
    
I tried allow-hotplug again, this time with ifplugd, and it works. When eth0 is configured as allow-hotplug, it is not started by /e/init.d/networking, avoiding the DHCP timeout issues. ifplugd will then configure eth0 at boot if a cable is plugged in. So, I've got a method to accomplish what I want, but the original question still irks me, is dhclient.conf being ignored during boot? –  Jeffrey Wildman Feb 22 '12 at 16:11
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.