Logging Option 82

Mike Diggins diggins at McMaster.CA
Sat May 13 03:15:54 UTC 2006


On Fri, 12 May 2006, Greg G wrote:

>
> Is there a way to cause Option 82 information to be written into the
> dhcp log file?  I've been getting some tracking requests lately for some
> older information.

This should work:

#
# 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)));

}


-Mike


More information about the dhcp-users mailing list