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.

2
  • 2
    Not sure if it fixes all your problems, but there is a ; missing in the range 192.168... line
    – faker
    Dec 27, 2012 at 13:55
  • 1
    @faker, I tried. it is not fixed.
    – sat
    Dec 27, 2012 at 14:07

1 Answer 1

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.

6
  • 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, 2012 at 17:16
  • see above what the ubuntu documentation says.
    – mgabriel
    Dec 27, 2012 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, 2012 at 5: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, 2012 at 9: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 2, 2013 at 13:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.