dhcp option 82 information
Mike Diggins
mike.diggins at McMaster.CA
Wed Aug 26 01:33:58 UTC 2009
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)));
}
-Mike
More information about the dhcp-users
mailing list