# DHCP not working (no free leases)

## atavus

Hi!

I've got problems establishing a dhcp server.

When I start the sever it posts that everything is ok:

```

atavus ramirez # /etc/init.d/dhcp restart

 * Re-caching dependency info (mtimes differ)...

 * Stopping dhcpd ...                                                                       [ ok ]

 * Setting ownership on dhcpd.leases ...                                            [ ok ]

 * Starting dhcpd ...                                                                        [ ok ]

atavus ramirez #

```

That looks fine, but a dhcp client can't get an IP.

In log I can find following msg:

 *Quote:*   

> 
> 
> Sep 23 00:12:52 atavus dhcpd: Wrote 0 deleted host decls to leases file.
> 
> Sep 23 00:12:52 atavus dhcpd: Wrote 0 new dynamic host decls to leases file.
> ...

 

my dhcpd.conf:

```

ddns-update-style none;

option space PXE;

option PXE.mtftp-ip               code 1 = ip-address;

option PXE.mtftp-cport            code 2 = unsigned integer 16;

option PXE.mtftp-sport            code 3 = unsigned integer 16;

option PXE.mtftp-tmout            code 4 = unsigned integer 8;

option PXE.mtftp-delay            code 5 = unsigned integer 8;

option PXE.discovery-control      code 6 = unsigned integer 8;

option PXE.discovery-mcast-addr   code 7 = ip-address;

subnet 192.168.1.0 netmask 255.255.255.0 {

  class "pxeclients" {

    match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";

    option vendor-class-identifier "PXEClient";

    vendor-option-space PXE;

    option PXE.mtftp-ip 0.0.0.0;

    filename "pxelinux.0";

    next-server 192.168.1.1;

  }

  

  class "etherboot" {

        if substring (option vendor-class-identifier, 0, 9) = "Etherboot" {

        filename "/diskless/vmlinuz";

        }

  }

#  pool {

#    max-lease-time 86400;

#    default-lease-time 86400;

    # This prevents unlisted machines from getting an IP

    #deny unknown-clients;

#  }

  host disklessdrone {

       

       hardware ethernet                00:50:70:d1:15:c1;

              fixed-address                    192.168.1.21;

       server-name                      "atavus";

              option routers                   192.168.1.1;

              option domain-name-servers       192.168.1.1;

       option domain-name               "wilanowska.waw.pl";

              option host-name                 "disklessdrone";

              option root-path                 "/diskless/192.168.1.21";

       if substring (option vendor-class-identifier, 0, 9) = "Etherboot" {

                        filename "/vmlinuz_arch";

        } else if substring (option vendor-class-identifier, 0,9) ="PXEClient" {

                        filename "/pxelinux.0";

        }

  }

}

```

my /dec/conf.d/dhcp:

```

# Copyright 1999-2004 Gentoo Foundation

IFACE="eth1"

DHCPD_OPTS="-q"

```

I will be very  grateful  for any help!

----------

## Spooky Ghost

I think you need a range in your subnet {}  declaration, on my system:

subnet 192.168.1.0 netmask 255.255.255.0 {

    range 192.168.1.128 192.168.1.143 ;

}

----------

## bigfunkymo

I am no expert on DHCP configuration, but I would have to agree, you will need to specify a network.

----------

## atavus

I will try that

----------

## atavus

Well... it does not work, but thanks anyway  :Crying or Very sad:   :Sad: 

 *Quote:*   

> 
> 
> atavus ramirez # /etc/init.d/dhcp restart
> 
> * Stopping dhcpd ...                                                     [ ok ] 
> ...

 

```

Sep 23 19:39:31 atavus dhcpd: /etc/dhcp/dhcpd.conf line 85: expecting a declaration

Sep 23 19:39:31 atavus dhcpd:   }

Sep 23 19:39:31 atavus dhcpd:   ^

Sep 23 19:39:31 atavus dhcpd: Configuration file errors encountered -- exiting

Sep 23 19:39:31 atavus dhcpd:

Sep 23 19:39:31 atavus dhcpd: If you did not get this software from ftp.isc.org, please

Sep 23 19:39:31 atavus dhcpd: get the latest from ftp.isc.org and install that before

Sep 23 19:39:31 atavus dhcpd: requesting help.

Sep 23 19:39:31 atavus dhcpd:

Sep 23 19:39:31 atavus dhcpd: If you did get this software from ftp.isc.org and have not

Sep 23 19:39:31 atavus dhcpd: yet read the README, please read it before requesting help.

Sep 23 19:39:31 atavus dhcpd: If you intend to request help from the dhcp-server@isc.org

Sep 23 19:39:31 atavus dhcpd: mailing list, please read the section on the README about

Sep 23 19:39:31 atavus dhcpd: submitting bug reports and requests for help.

Sep 23 19:39:31 atavus dhcpd:

Sep 23 19:39:31 atavus dhcpd: Please do not under any circumstances send requests for

Sep 23 19:39:31 atavus dhcpd: help directly to the authors of this software - please

Sep 23 19:39:31 atavus dhcpd: send them to the appropriate mailing list as described in

Sep 23 19:39:31 atavus dhcpd: the README file.

Sep 23 19:39:31 atavus dhcpd:

Sep 23 19:39:31 atavus dhcpd: exiting.

```

----------

## ruurd

https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=144250

Seems to be a GCC bug :/

----------

