Logging

Niall O'Reilly Niall.oReilly at ucd.ie
Tue Dec 5 20:39:58 UTC 2006


On 5 Dec 2006, at 15:32, Kelvin Williams wrote:

> Could someone please point me towards some good documentation or  
> examples of
> logging.  I am specifically looking for a way to log the (Re)Leased  
> Address,
> the MAC Address, and some other bits of information whenever a  
> client is
> leased, releases, or renews an IP Address.

The dhcp.leases files and your syslog probably have all the data you  
need.
Extracting and formatting this to meet your purpose depends on what that
purpose is.

For example, dhcp.leases has a section like this for each lease:

lease 10.0.1.188 {
   starts 2 2006/12/05 19:57:15;
   ends 3 2006/12/06 07:57:15;
   binding state active;
   next binding state free;
   hardware ethernet 00:13:fd:41:10:91;
   uid "\001\000\023\375A\020\221";
}

And the syslog (on my systems, /var/log/messages):

Dec  5 20:37:35 bark dhcpd: DHCPDISCOVER from 00:11:24:2c:8b:78  
(sixte) via wifi
Dec  5 20:37:35 bark dhcpd: DHCPOFFER on 10.0.1.189 to 00:11:24:2c:8b: 
78 (sixte) via wifi
Dec  5 20:37:36 bark dhcpd: DHCPREQUEST for 10.0.1.189 (10.0.1.254)  
from 00:11:24:2c:8b:78 (sixte) via wifi
Dec  5 20:37:36 bark dhcpd: DHCPACK on 10.0.1.189 to 00:11:24:2c:8b: 
78 (sixte) via wifi

In my environment, DHCPRELEASE is relatively rare, so I don't have an  
example to hand.

I hope this helps.

/Niall



More information about the dhcp-users mailing list