LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   DHCP Server - No lease time? (http://www.linuxquestions.org/questions/linux-server-73/dhcp-server-no-lease-time-657148/)

piercey 07-21-2008 07:21 AM

DHCP Server - No lease time?
 
Hi,

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 (192.168.2.101 to 192.168.2.108) 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 :))?

Thanks,

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

Hi,

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:
Code:

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

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

# My actual DHCP served subnet
subnet 192.168.2.0 netmask 255.255.255.0 {
  range 192.168.2.101 192.168.2.101;
}

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

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

Jul 21 15:20:33 irtux dhcpd: DHCPREQUEST for 192.168.2.101 from 00:00:00:00:00:00 via eth1
Jul 21 15:20:33 irtux dhcpd: DHCPACK on 192.168.2.101 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:

Code:

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;

Code:

lease 192.168.2.101 {
  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)?

Thanks,

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


All times are GMT -5. The time now is 04:01 AM.