KanREN DHCP Seminar November 7-9, 2005

Troubleshooting DHCP—Lease and Log Files

When you need to find more information about what the server is doing, there are two places to look: the lease file, and the log file.

You've already encountered the lease file once—when you created an empty one in order to start the server. If you haven't looked at it since then, do so now—it's holding quite a bit of information.

lab1:/var/dhcp # less dhcpd.leases

# All times in this file are in UTC (GMT), not your local timezone. This is

# not a bug, so please don't ask about it. There is no portable way to

# store leases in the local timezone, so please don't request this as a

# feature. If this is inconvenient or confusing to you, we sincerely

# apologize. Seriously, though - don't ask.

# The format of this file is documented in the dhcpd.leases(5) manual page.

# This lease file was written by isc-dhcp-V3.0.4b2

lease 192.168.10.63 {

starts 1 2005/11/07 20:10:00;

ends 2 2005/11/08 20:10:00;

tstp 2 2005/11/08 20:10:00;

binding state active;

next binding state free;

hardware ethernet 00:03:93:72:c1:d2;

uid "\001\000\003\223r\301\322";

}

lease 192.168.10.63 {

starts 1 2005/11/07 20:10:00;

ends 1 2005/11/07 20:10:36;

tstp 1 2005/11/07 20:10:36;

binding state free;

}

The location of the log file varies based on the system running your DHCP server; some systems don't even enable logging by default. Here in the classroom, the log file is in /var/log/daemon, and also contains log messages from other programs. To view only DHCP log messages, do:

lab1:/var/dhcp # grep dhcpd /var/log/daemon | less

Nov 7 11:24:02 lab1 dhcpd: Internet Systems Consortium DHCP Server V3.0.4b2

Nov 7 11:24:02 lab1 dhcpd: Copyright 2004-2005 Internet Systems Consortium.

Nov 7 11:24:02 lab1 dhcpd: All rights reserved.

Nov 7 11:24:02 lab1 dhcpd: For info, please visit http://www.isc.org/sw/dhcp/

Nov 7 11:38:39 lab1 dhcpd: Internet Systems Consortium DHCP Server V3.0.4b2

Nov 7 11:38:39 lab1 dhcpd: Copyright 2004-2005 Internet Systems Consortium.

Nov 7 11:38:39 lab1 dhcpd: All rights reserved.

Nov 7 11:38:39 lab1 dhcpd: For info, please visit http://www.isc.org/sw/dhcp/

Nov 7 11:38:39 lab1 dhcpd: Wrote 0 leases to leases file.

Nov 7 11:38:39 lab1 dhcpd: Listening on BPF/xl0/00:50:da:10:e5:8c/192.168.10 /24

Nov 7 11:38:39 lab1 dhcpd: Sending on BPF/xl0/00:50:da:10:e5:8c/192.168.10 /24

Nov 7 11:38:39 lab1 dhcpd: Sending on Socket/fallback/fallback-net

Nov 7 11:41:34 lab1 dhcpd: DHCPDISCOVER from 00:03:93:72:c1:d2 via xl0

Nov 7 11:41:35 lab1 dhcpd: DHCPOFFER on 192.168.10.63 to 00:03:93:72:c1:d2 via xl0

Nov 7 11:41:36 lab1 dhcpd: DHCPREQUEST for 192.168.10.63 (192.168.10.253) fr om 00:03:93:72:c1:d2 via xl0

Nov 7 11:41:36 lab1 dhcpd: DHCPACK on 192.168.10.63 to 00:03:93:72:c1:d2 via xl0

...

2005-11-07T09:22:35