Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a server running Ubuntu 11.04, deployed in the field. When someone is debugging the server, they plug eth1 in, but the rest of the time, nothing is plugged into eth1. The syslog is full of DHCPDISCOVER requests from dhclient trying to find a connection. Is there any way I can configure dhclient to only run DHCPDISCOVER a fixed number of times?

Syslog entries every:

Nov  2 07:58:32 sensor-2bb8 dhclient: DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 3
Nov  2 07:58:35 sensor-2bb8 dhclient: DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 4
Nov  2 07:58:39 sensor-2bb8 dhclient: DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 8
Nov  2 07:58:47 sensor-2bb8 dhclient: DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 15
Nov  2 07:59:02 sensor-2bb8 dhclient: DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 13
Nov  2 07:59:15 sensor-2bb8 dhclient: DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 14
Nov  2 07:59:29 sensor-2bb8 dhclient: DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 4
Nov  2 07:59:33 sensor-2bb8 dhclient: No DHCPOFFERS received.
Nov  2 07:59:33 sensor-2bb8 dhclient: No working leases in persistent database - sleeping.

Contents of /etc/network/interfaces:

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth1
iface eth1 inet dhcp
share|improve this question

3 Answers 3

up vote 3 down vote accepted

If the device supports hotplug events why not use allow-hotplug eth1 instead of auto eth1. This should mean that the defaults will only try to enable itself if there is actually a link available. The auto setting means that the interface will be brought up no matter what the status of the interface is.

share|improve this answer

In my opinion tweaking dhclient is not good idea(it can brought you to problems obtaining adresses in future).

You should better turn off the interface and turn on when needed(interface eth1 down/up).

There is a linux daemon called ifplugd that can automatically turn on and configure interface when you plug the cable and turn of interface when unplugged.

share|improve this answer

There are several options for this case: http://linux.die.net/man/5/dhclient.conf

share|improve this answer

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.