Leasetime in class?

Tom Schmitt TomSchmitt at
Tue Jun 19 11:46:40 UTC 2007


I use the ISC-dhcpd 3.0.5 and have a problem to understand its behaviour.

I have PXE-clients and want to give a different (shorter) leasetime to the PXE-NICs than I give to the PCs themself.

My solution was to write a class for PXE with a different leasetime.

This is my config:

ddns-update-style interim;
ddns-updates true;
update-optimization false;
update-static-leases false;
deny declines;
min-lease-time 43199;
default-lease-time 43200; # 12 hours
max-lease-time 43201; 
lease-file-name "/var/dhcp/dhcpd.leases";
log-facility local7;
omapi-key SECRETKEY;
omapi-port 7911;
pid-file-name "/var/dhcp/";
ping-check true;
deny client-updates;

class "PXE" {
    match if substring(option vendor-class-identifier, 0, 9) = "PXEClient";
       min-lease-time 238;
       default-lease-time 239;
       max-lease-time 240; # 4 minutes
       log (info, " * * * * * __________Matched PXE__________ * * * * *");
subnet netmask {
        option broadcast-address;
        option domain-name "mydomain.local";
        option routers;
        option ntp-servers;
        option subnet-mask;
        option domain-name-servers;
        option netbios-name-servers;
        if substring(option vendor-class-identifier, 0, 9) = "PXEClient"
                log (info, "Matched PXE too");
                option tftp-server-name "";
                option dhcp-server-identifier;
                option vendor-class-identifier "PXEClient";
    #            min-lease-time 238;
    #            default-lease-time 239;
    #            max-lease-time 240; #vier Minuten
             deny dynamic bootp clients;
        algorithm hmac-md5;
        secret "secret";
zone mydomain.local. {
zone {
        key dhcp;
subnet netmask
        option broadcast-address;
        option domain-name-servers;
        option ntp-servers;
        option routers;
        option subnet-mask;

The log-line in the class-statement has the purpose that I can see in the logfile wether the class-statement was used or not.

When a PXE-client is booting I see the log-line in the log-file, so I assume, that the class-statement was actually used as expected.
But: If I have a look into the lease-database I see, that the leasetime for the PXE-client is still 12 hours and not 4 minutes! Why?

If I delete the class-statement and put the leasetime-lines into the pxe-statement in the subnet (in fact deleting the # you see above), it is working as expected:
The PXE-client actually gets a 4-minute-lease.

But why isn't it working with the leasetime-lines in the class-statement? Thats what I don't understand.

And of course it would be nicer to solve this with a class, because otherwise I have to add these lines in every subnet I have.

Maybe somone can help me here?
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN:

More information about the dhcp-users mailing list