-   Linux - Server (
-   -   DHCP Server - No lease time? (

piercey 07-21-2008 07:21 AM

DHCP Server - No lease time?

I have a DHCP server which is connected to an 8 port hub. The devices connected to the hub will be swapped out every few minutes. I'm wondering if there is an easy way to disable lease times, ie. when one of the devices is swapped out it will give its IP to the new device instantly.

The DHCP server is the normal one from ISC. I have it set to give out 8 IP address ( to and I have set the default and max lease-time to "0". This seems to work but my log is filled with constant DHCP requests and acknowledgments.

Is this the correct way to do what I want or is there a better way (preferably less log heavy :))?


pinniped 07-21-2008 08:22 AM

It depends on the implementation at one end. If the dhcp server detects a disconnect it should free that IP (unless you configured for persistent leases). Some dhcp servers are broken and require the clients to send a notification that they're disconnecting.

Can you set the 'default' lease time to, say, 1 day (or the maximum if you wish) and the 'max lease time' to zero? What seems to be happening is that your server is relinquishing the lease every second based on the default. Personally I would have expected a default of 0 to mean 'permanent'.

piercey 07-21-2008 11:15 AM


Thanks for the reply. I'll try provide a bit more information this time around about the DHCP server. I've taken your suggestion above and this is what's happening:

I'm using DHCP (from ISC) version 3.1.1. This is my dhcpd.conf:

# dhcpd.conf
option domain-name "internal";
ddns-update-style none;
default-lease-time 600;
max-lease-time 0;
log-facility local7;

# No service will be given on this subnet, but declaring it helps the
# DHCP server to understand the network topology.
subnet netmask {

# My actual DHCP served subnet
subnet netmask {

As you can see it is set to give out only 1 IP address, (for testing purposes - it will be 8 in total later).

So I plug in the first device, and it requests the IP like so:

Jul 21 15:20:33 irtux dhcpd: DHCPREQUEST for from 00:00:00:00:00:00 via eth1
Jul 21 15:20:33 irtux dhcpd: DHCPACK on to 00:00:00:00:00:00 via eth1

I then switch the ethernet cable to a second device looking for DHCP and I get the following:


Jul 21 15:27:20 irtux dhcpd: DHCPDISCOVER from 00:00:00:00:00:00 via eth1: network 192.168.2/24: no free leases
The odd thing is my log file is populated by DHCPREQUEST and DHCPACK every 3 minutes (from the first device) even though my lease file contains this;


lease {
  starts 1 2008/07/21 16:59:47;
  ends 1 2008/07/21 16:59:47;
  cltt 1 2008/07/21 16:59:47;
  binding state active;
  next binding state free;
  hardware ethernet 00:00:00:00:00:00;
  uid "\001\000`.\0020d";

Which shows a lease of 0 minutes. Is there anything glaringly wrong about my configuration, or is what I want unacceptable (ie. non permanent leases)?


ps. Don't mind the MAC address' being all zeros :)

All times are GMT -5. The time now is 07:31 AM.