Option 82 log agent.remote-id

Tom Greaser tgreaser at hsc.wvu.edu
Mon May 12 09:59:14 UTC 2008


I seem to have found the exact config statement needed to log the remote id..

 if exists agent.remote-id
{
        log ( info, concat( "DHCPAGENT for lease of ", binary-to-ascii (10, 8, ".", leased-address), " on agent ",
        binary-to-ascii(16, 8, ":", substring( option agent.remote-id, 2, 6))));
}



However dhcp isnt seeing the ascii info.. its just putting hex..  here is what my logs show

May 12 05:53:30 pippin dhcpd: DHCPAGENT for lease of 10.3.3.16 on agent 68:73:63:2d:32:32

wireshark  does show hsc-2260 (option 82 info) ..

Again.. can anyone point me in the right direction.. ??  I know your all way smarter than I .....
and i know a ton of other people out there are begging to do this.. well ok i know of only 1.. ME.. lol



 
>>> "Tom Greaser" <tgreaser at hsc.wvu.edu> 05/09/08 7:39 AM >>> 
I did my best to search the archives .. as I was sure this question has been asked..

The newer cisco code allows you inject a string or switch host name for the agent.remote-id
used hsc-2260 as the string on the switch.  I see it in the sniff packets, but i cant seem to figure out how to get it in the logs..

If someone has already done so,  would you post your dhcp conf ..  If not.. I cant seem to find
the url / pdf / txt i had on how the log concat worked..  any direction on a good howto to 
re learn how to get the data out would be very helpful..

Like 99% of the people out there i got my base conf from  http://www.thtech.net/article/10
the second snip .. i did find on the net but can remember where.. (just want to give credit where credit is do)

1 last thing.. Ive been reading around so much / diff vendor stuff.. I just want to make sure the ver of isc dhcp we have
running support the agent.remote-id .. I think it does.. but way more smarter people on this list than I.

here is my current log statement   dhcp V3.0.5-RedHat


if exists agent.circuit-id
{
        log ( info, concat( "Lease for ", binary-to-ascii (10, 8, ".", leased-address), " connected to interface ",
        binary-to-ascii (10, 8, "/", suffix ( option agent.circuit-id, 2)), " (3750s subtract 2or4!), VLAN ",
        binary-to-ascii (10, 16, "", substring( option agent.circuit-id, 2, 2)),  " HWADD ",
        binary-to-ascii(16, 8, ":", hardware)));

        log ( info, concat ( "Switch" ,binary-to-ascii (10,8,"", substring(option agent.remote-id,9,1)),
         binary-to-ascii(10,16,"",suffix(option agent.remote-id,2)),
         " IP ", (binary-to-ascii(10, 8, ".", packet(12,4))),
         " MAC ", (binary-to-ascii(16, 8, ":", suffix(hardware,6))),
         " ROUTER ", (binary-to-ascii(10,8,".",substring(option agent.remote-id,4,4)))));

}

dhcpd.log output

May  9 07:28:40 pippin dhcpd: Lease for 10.3.3.16 connected to interface 1/4 (3750s subtract 2or4!), VLAN 3 HWADD 1:0:d:60:78:65:bb
May  9 07:28:40 pippin dhcpd: Switch4813872 IP 0.0.0.0 MAC 0:d:60:78:65:bb ROUTER 99.45.50.50













More information about the dhcp-users mailing list