6

I would like to have a small dynamic adress part and the most clients are assigned a fixed IP adress.

My dhcpd.conf looks like this:

use-host-decl-names on;
authoritative;
allow client-updates;
ddns-updates on;

# Einstellungen fuer DHCP leases
default-lease-time 3600;
max-lease-time 86400;

lease-file-name "/var/lib/dhcpd/dhcpd.leases";

  subnet 192.168.11.0 netmask 255.255.255.0 {
        ddns-updates on;
    pool {
        # IP range which will be assigned statically
        range 192.168.11.1 192.168.11.240;
        deny all clients;
    }
    pool {
        # small dynamic range
        range 192.168.11.241 192.168.11.254; # used for temporary devices
    }
}    

 group {
    host pc1 {
        hardware ethernet xx:xx:xx:xx:xx:xx;
        fixed-address 192.168.11.11;
        }
}

The motivation for the pool declaration with deny all hosts comes from the ISC DHCPD homepage http://www.isc.org/files/auth.html This will allow hosts to be first added to the network, where they will receive a temporary IP from the 241-254 adress range and then later write an explicit host declaration. Upon next connect it will receive the right configuration.

The problem is that I am getting error messages that 192.168.11.13 has a dynamic and a static lease. I am a bit confused as I expected the pool declaration with deny all clients would not count as dynamic.

  Dynamic and static leases present for 192.168.11.13.
  Remove host declaration pc1 or remove 192.168.11.13
  from the dynamic address pool for 192.168.11.0/24

Is there a way to have the DHCP server send an DHCPNA to clients if they have a host statement and retain this dynamic range?

GorillaPatch
  • 477
  • 3
  • 9
  • 19
  • I believe your `range 192.168.11.1 192.168.11.240;` would present a problem. Why didn't you just omit the definition of pool entirely? – the-wabbit Apr 04 '12 at 18:16
  • That is the problem, yes. I have the pool in there because of this page http://www.isc.org/files/auth.html It should send the client a DHCPNAK message and resets it if it has an old lease of the dynamic pool but meanwhile the proper host entry was added. – GorillaPatch Apr 04 '12 at 19:38
  • 1
    Check your `/etc/db/dhcpd.leases` file, there's probably an outstanding lease for 192.168.11.13 and the server is confused because the existing client is sending a release request. – Chris S Apr 11 '12 at 21:56

1 Answers1

6

The configuration checker would just match your defined pools and host address definitions against each other to find definition intersections, it would not evaluate access lists.

So you would have to explicitly exclude your host definitions range from the "deny all" pool definition:

pool {
    # IP range which will be assigned statically
    range 192.168.11.1 192.168.11.10
    range 192.168.1.12 192.168.11.240;
    deny all clients;
}
the-wabbit
  • 40,319
  • 13
  • 105
  • 169