Logging only DHCPACK

Glenn Satchell Glenn.Satchell at uniq.com.au
Fri Feb 20 10:32:36 UTC 2009

>Date: Fri, 20 Feb 2009 10:07:41 +0000
>From: "Niall O'Reilly" <Niall.oReilly at ucd.ie>
>Subject: Re: Logging only DHCPACK
>To: Users of ISC DHCP <dhcp-users at lists.isc.org>
>X-BeenThere: dhcp-users at lists.isc.org
>On Fri, 2009-02-20 at 10:56 +0100, Jessica Meyer wrote:
>> I have set up a simple log() function in my dhcpd.conf file, which
>> should log every ip address leased out:
>> log ( info, concat ( "Lease: ", binary-to-ascii (10, 8, ".",
>> leased-address)));
>	I'm wondering what your purpose is?
>	Don't DHCPACK entries appear in your log already, for
>	no specific effort?
>	/Niall
Each packet gets processed a few times in the handshake, so you can add an 'if' 
around the log to only log during one phase. This is from dhcp-options man page:

     option dhcp-message-type uint8;

       This option, sent by both client and server, specifies the
       type  of DHCP message contained in the DHCP packet. Possi-
       ble values (taken directly from RFC2132) are:

                    1     DHCPDISCOVER
                    2     DHCPOFFER
                    3     DHCPREQUEST
                    4     DHCPDECLINE
                    5     DHCPACK
                    6     DHCPNAK
                    7     DHCPRELEASE
                    8     DHCPINFORM

       This option is not user configurable.

A bit of experimentation may be required to test for the exact phase,
but something like:

if option dhcp-message-type = 5 {
    log ( info, concat ( "Lease: ",
        binary-to-ascii (10, 8, ".", leased-address)));


More information about the dhcp-users mailing list