Logging every packet that the DHCP server receives

jeffrey j donovan donovan at beth.k12.pa.us
Mon Oct 15 01:07:02 UTC 2012

On Oct 12, 2012, at 2:07 PM, Sven Seelemann <sven.seelemann at alcatel-lucent.com> wrote:

> Hi,
> I'm trying to determine why some class declarations of mine are fail - for a pool of over a thousand IPs I'm receiving an awful lot of "no free leases."
> I'm trying to print via the log command parts of the DHCP packet. My log statements are before class statements as well as before the network description with its subnets and pools. That is, I think they should be global in scope.
> Unfortunately, when I run in debug mode (or in deamon mode, fwtw) all I get are the "no free leases" error - I don't see my log message(s). In fact, the log message only shows up when the corresponding DHCP request is successful...
> My log statements:
> #  To find the relay agent IP address...
> log (info, concat("Packet has ->", binary-to-ascii(16, 8, ":", packet(24,4))));
> # To find the string added by the as a vendor supplied option...
> #log (info, concat("Packet has in hex ->", binary-to-ascii(16, 8, ":", packet(346,4)), "<- or raw ->", packet(346,4)));
> log (info, concat("Packet has in hex ->", binary-to-ascii(16, 8, ":", packet(388,4)), "<- or raw ->", packet(388,4)));
> Any pointers on how to make dhcpd a little more verbose about what it doesn't like?
> Thanks in advance,
> Sven.


i have dhcpd logging to syslog ( which is typical ), then I grep for patterns 
in syslog I see every transaction 

in dhcpd.conf i have

log-facility local7;


*.notice;kern,authpriv,remoteauth,ftp,install.none;mail.crit;local7.*	/var/log/system.log

i also use a tool called dhcpstatus found here http://dhcpstatus.sourceforge.net/ , it is a script that will format your lease file and make it easier to read.


More information about the dhcp-users mailing list