Example config with option 82

Blake Hudson blake at ispn.net
Mon Jun 16 15:59:14 UTC 2008


I'm just logging, not actually doing anything with the option82 info we 
may or may not receive depending on which network the customer is coming 
from.


...
#Only look at DHCP Requests (not discovers, offers, acks, etc) and 
contains OPTION 82
if option dhcp-message-type = 3 and exists agent.circuit-id
{

        #Calix format...
        if substring(option agent.remote-id, 0, 1) = "N" or 
substring(option agent.remote-id, 0, 1) = "n"
        {
                # Log Circuit ID
                log ( info, concat( "Calix OPTION-82 for ", 
binary-to-ascii (10, 8, ".",leased-address)," from ",
                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),
                " Circuit ID: ", (option agent.circuit-id), "."));
               
                # Log Agent ID
                log ( info, concat( "Calix OPTION-82 for ", 
binary-to-ascii (10, 8, ".",leased-address)," from ",
                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),
                " Agent ID: " , (option agent.remote-id),"."));
        }      
        else #Assume Cisco format
        {
                log ( info, concat( "Cisco OPTION-82 for ", 
binary-to-ascii (10, 8, ".", leased-address), " is connected to 
interface ",   
                binary-to-ascii (10, 8, "/", suffix ( option 
agent.circuit-id, 2)), " (add 1 to port number!), 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( "Cisco OPTION-82 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)));
        }

}

## IP Pools
        include "/etc/dhcpd.pools";

## Host Entries
        include "/etc/dhcpd.hosts";

....



-------- Original Message  --------
Subject: Example config with option 82
From: Corley, Kenneth L (Kenny) <corley at alcatel-lucent.com>
To: dhcp-users at isc.org <'dhcp-users at isc.org'>
Date: Monday, June 16, 2008 10:15:27 AM
>
> Does anyone have a basic dhcpd config that includes option 82 that 
> they can share?  I am running 3.0.5.
>
> Thanks
> Kenny
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20080616/087252d5/attachment.html>


More information about the dhcp-users mailing list