1

We're using a Debian 9 install on a Minnowboard (a small, embedded system). The Debian 9 install is nothing special - it's the regular Debian 9 image that we got from the Debian website, and had to install from scratch with the Debian installer.

The problem that we're seeing is that sometimes, when the Minnowboard starts up, Debian's DHCP client won't grab an IP, and it seems to take it several minutes to try again, until eventually, it does grab one. Manually using dhclient, Debian has no problems grabbing an IP.

The reason that the Linux DHCP client doesn't grab an IP on the first try may be explained by the fact that the same power supply that powers the Minnowboard also powers the Router (they normally begin their start-up at the same time), so the router (DHCP server) may not be booted up yet when the minnowboard first requests an IP.

Is there any config file we can change to make Debian's default DHCP client request an IP more frequently if the interface is configured for DHCP, and doesn't have an IP yet?

On a related topic, what controls the DHCP client in Debian 9? Is there some service that systemd is running that monitors to make sure DHCP leases aren't expired, and renews them as needed?

Note: Not sure if this is relevant, but I did this trick, and set GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0" to set the network interface name back to eth0.

1 Answer 1

1

You can configure dhclient's timeout and retry settings in /etc/dhcp/dhclient.conf. Setting retry to 60 seconds or less is probably what you want.

From man dhclient.conf (with extra linefeeds and bolding for emphasis added):

PROTOCOL TIMING

The timing behaviour of the client need not be configured by the user. If no timing configuration is provided by the user, a fairly reasonable timing behaviour will be used by default - one which results in fairly timely updates without placing an inordinate load on the server.

If required the following statements can be used to adjust the timing behaviour of the DHCPv4 client. The DHCPv6 protocol provides values to use and they are not currently configurable.

The timeout statement

timeout time;

The timeout statement determines the amount of time that must pass between the time that the client begins to try to determine its address and the time that it decides that it's not going to be able to contact a server.

By default, this timeout is sixty seconds.

After the timeout has passed, if there are any static leases defined in the configuration file, or any leases remaining in the lease database that have not yet expired, the client will loop through these leases attempting to validate them, and if it finds one that appears to be valid, it will use that lease's address.

If there are no valid static leases or unexpired leases in the lease database, the client will restart the protocol after the defined retry interval.

The retry statement

retry time;

The retry statement determines the time that must pass after the client has determined that there is no DHCP server present before it tries again to contact a DHCP server.

By default, this is five minutes.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .