dhcp option 82 information

Mike Diggins mike.diggins at mcmaster.ca
Wed Aug 26 17:48:39 UTC 2009



On Wed, 26 Aug 2009, Glenn Satchell wrote:

>
>> Date: Tue, 25 Aug 2009 21:33:58 -0400 (Eastern Daylight Time)
>> From: Mike Diggins <mike.diggins at McMaster.CA>
>> To: dhcp-users at lists.isc.org
>> Subject: dhcp option 82 information
>>
>> My routers insert dhcp option 82 information into the DHCP requests so
>> that my DHCP server knows what switch and port the request came from. Does
>> anyone have an ISC DHCPd configuration that will extract that info and log
>> it to syslog? I had been using this with RHEL4, but in RHEL5 64 bit, it
>> doesn't quite work as expected.
>>
>>
>> # Log something useful if dhcp option 82 information is present
>> #
>> if exists agent.circuit-id
>> {
>>   log ( info, concat( "Lease for ", binary-to-ascii (10, 8, ".",
>> leased-address), " is connected to interface ",
>>   binary-to-ascii (10, 8, "/", suffix ( option agent.circuit-id, 2)), ",
>> VLAN ",
>>   binary-to-ascii (10, 16, "", substring( option agent.circuit-id, 2, 2)),
>> " on switch ",
>>   binary-to-ascii(16, 8, ":", substring( option agent.remote-id, 2, 6))));
>>
>>   log ( info, concat( "Lease for ", binary-to-ascii (10, 8, ".",
>> leased-address),
>>   " raw option-82 info is CID: ", binary-to-ascii (10, 8, ".", option
>> agent.circuit-id), " AID: ",
>>   binary-to-ascii(16, 8, ".", option agent.remote-id)));
>>
>> }
>
> What if any log entries are you getting?
>
> What facility and priority is set in dhcpd.conf and /etc/syslog.conf?
> There may be a mismatch with the upgraded OS.
>
> This is from dhcpd.conf man page for 4.1.1b1 (may be different on older
> releases, in particular the default facility)
>
>       log-facility facility;
>
>       This statement causes the DHCP server to  do  all  of  its
>       logging  on the specified log facility once the dhcpd.conf
>       file has been read.   By default the DHCP server  logs  to
>       the  daemon  facility.    Possible  log facilities include
>       auth, authpriv, cron, daemon, ftp, kern, lpr, mail,  mark,
>       news,  ntp,  security,  syslog,  user,  uucp,  and  local0
>       through local7.   Not all of these facilities  are  avail-
>       able  on  all  systems,  and there may be other facilities
>       available on other systems.
>
>       In addition to setting this value, you may need to  modify
>       your  syslog.conf  file  to  configure logging of the DHCP
>       server.   For example, you might add a line like this:
>
>            local7.debug /var/log/dhcpd.log
>
> regards,
> -glenn
>


Sorry, it is logging correctly. I posted earlier that I was getting some 
weird log entries like these:

Aug 26 04:08:47 dhcpd: data: "leased-address" configuration 
directive: there is no lease associated with this client.
Aug 26 04:08:47 dhcpd: data: "leased-address" configuration 
directive: there is no lease associated with this client.

When I remove my extra logging configuration, these messages go away! So I 
think something has changed with ISC DHCP. Trouble is, I scooped those 
logging statements off a web site, and I'm not sure what specifically is 
causing those strange messages. Otherwise though, it does log what I want.

Aug 26 04:04:31 dhcpd: Lease for 172.17.49.20 is connected to 
interface 1/34, VLAN 362 on switch 0:1f:6d:5c:ec:0
Aug 26 04:04:31 dhcpd: Lease for 172.17.49.20 raw option-82 info 
is CID: 0.4.1.106.1.34 AID: 0.6.0.1f.6d.5c.ec.0

I thought someone might have a logging configuration that works properly.

-Mike




More information about the dhcp-users mailing list