5

I am facing no free leases issue. I am building a new server. I have successfully installed ltsp. Then, I configured the dhcp. This is my dhcpd.conf file.

option subnet-mask 255.255.255.0;
option broadcast-address 192.168.12.255;
option routers 192.168.12.205;
option domain-name-servers 192.168.12.205;

default-lease-time 600;
max-lease-time 7200;

next-server 192.168.12.205;

option root-path "192.168.12.205:/opt/ltsp/i386/";

subnet 192.168.12.0 netmask 255.255.255.0  {

range 192.168.12.55 192.168.12.100;

        host client1 {
                option root-path "192.168.12.205:/opt/ltsp/i386/";
                filename "/ltsp/i386/pxelinux.0";
                hardware ethernet 00:1d:72:04:8d:a9;
                fixed-address 192.168.12.69;
        }

}

Error is,

Dec 27 18:18:35 Dennis dhcpd: Wrote 0 leases to leases file.
Dec 27 18:23:27 Dennis dhcpd: DHCPDISCOVER from 00:1d:72:04:8d:a9 via eth0: network 192.168.12/24: no free leases

I referred in internet and tried. But, I am not able to fix.

Can you guide me to fix this issue.

sat
  • 1,273
  • 4
  • 13
  • 14

1 Answers1

2

Your dhcpd probably needs write access to the leases file.

From http://manpages.ubuntu.com/manpages/lucid/man5/dhcpd.leases.5.html:

When dhcpd is first installed, there is no lease database. However, dhcpd requires that a lease database be present before it will start. To make the initial lease database, just create an empty file called /var/lib/dhcp3/dhcpd.leases. You can do this with:

touch /var/lib/dhcp3/dhcpd.leases

This should fix your problem.

mgabriel
  • 1,091
  • 9
  • 15
  • 1
    Well, I don't think you really need to create this file. Even if you remove this file, you just need to restart the dhcp server, and this file will be automatically created. – Napster_X Dec 27 '12 at 17:16
  • see above what the ubuntu documentation says. – mgabriel Dec 27 '12 at 22:50
  • @mgabriel , The dhcpd.leases file has been created automatically. There is no content in the file. But, Still it is giving same error. – sat Dec 28 '12 at 05:33
  • try a chmod 0777 /var/lib/dhcp3/dhcpd.leases just to test if there is a problem with the write permissions. – mgabriel Dec 29 '12 at 09:28
  • 1
    @mgabriel , It is fixed. First, I deleted the /var/lib/dhcp3/dhcpd.leases file. Then, I created the new file with 0777 permission and changed the ownership to dhcpd. Now, It is okay. – sat Jan 02 '13 at 13:48
  • With proper file ownership (such as user "dhcpd" on my system), you can back permissions off to 644, or maybe even less. No need for Execute permissions, as far as I can see. – kmarsh Jun 16 '16 at 18:33