Option 82.

Pat Winn ptwinn at cimtel.net
Mon Jun 21 16:02:30 UTC 2010


The only problem with adding both the agent.id and remote.id
is that if either of those variables are not present/set,
the log line will not be sent out to the syslog daemon.

That is one nasty "behavior" in ISC's dhcpd.
Any log line that has an empty or missing variable
in it simply doesn't print.

You might try something more like this in your dhcpd.conf:

if((option dhcp-message-type = 3 or option dhcp-message-type = 5) and
exists agent.circuit-id) {
    log(info, concat( "OPT82=1|IP=",
        binary-to-ascii (10, 8, ".",leased-address),
        "|MAC=",
        suffix (concat("0", binary-to-ascii (16, 8, "",
        substring( hardware, 1, 1))),2),":",
        suffix (concat("0", binary-to-ascii (16, 8, "",
        substring( hardware, 2, 1))),2),":",
        suffix (concat("0", binary-to-ascii (16, 8, "",
        substring( hardware, 3, 1))),2),":",
        suffix (concat("0", binary-to-ascii (16, 8, "",
        substring( hardware, 4, 1))),2),":",
        suffix (concat("0", binary-to-ascii (16, 8, "",
        substring( hardware, 5, 1))),2),":",
        suffix (concat("0", binary-to-ascii (16, 8, "",
        substring( hardware, 6, 1))),2), "|CID=",
        (option agent.circuit-id)));
}

This would output a line something like:
OPT82=1|IP=1.2.3.4|MAC=00:0a:2a:11:22:22|CID=your circuit id goes here

Then you can do the same for remote-id if you wish.

You could also put some addition tests inside the main test to see if
remote id is present and if so, set a variable to that value or to
some non-empty value (like "none" or something) so that it could be
included in the line above..without causing it to not print if not present.

---
Patrick T. Winn
Senior Systems Engineer
Cimarron Telephone Co.
(918) 865-3311 x280 - office
(918) 606-6602 - cell




While counting 0's and 1's, Patricio Latini said:
> Keith I add this line within the subnet configuration
>
> log (info,concat("Hardware Address : ",binary-to-ascii (16,
> 8,":",substring(hardware,1,6))," - Circuit ID :
> ",binary-to-ascii(16,8,":",option agent.circuit-id)," - Remote ID : ",
> binary-to-ascii(16,8,":",option agent.remote-id)));
>
> Hope it is useful for you
>
> Patricio
>
> -----Original Message-----
> From: dhcp-users-bounces+p_latini=hotmail.com at lists.isc.org
> [mailto:dhcp-users-bounces+p_latini=hotmail.com at lists.isc.org] On Behalf
> Of
> Keith
> Sent: Friday, June 18, 2010 5:49 PM
> To: dhcp-users at lists.isc.org
> Subject: Option 82.
>
>
> I want to turn on option 82 on some dslams. I just want to see what will
> come through (I have a pretty good idea), but if I don't configure dhcp to
> acutally use option 82 info, will I still be able to see the info that
> comes through in the dhcp log file?
>
> Thanks,
> Keith
>
> _______________________________________________
> dhcp-users mailing list
> dhcp-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users
>
>
> __________ Information from ESET Smart Security, version of virus
> signature
> database 5208 (20100618) __________
>
> The message was checked by ESET Smart Security.
>
> http://www.eset.com
>
>
>
> __________ Information from ESET Smart Security, version of virus
> signature
> database 5208 (20100618) __________
>
> The message was checked by ESET Smart Security.
>
> http://www.eset.com
>
>
> _______________________________________________
> dhcp-users mailing list
> dhcp-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users
>





More information about the dhcp-users mailing list