#
# Sample configuration file for ISC dhcpd using Option 82
#

option domain-name "foo.com";
local-address 10.1.1.10;
option subnet-mask 255.255.255.0;
default-lease-time 60000;
max-lease-time 62000;
ddns-update-style ad-hoc;

subnet 10.1.1.0 netmask 255.255.255.0 {
  option broadcast-address 10.1.1.255;
  option subnet-mask 255.255.255.0;

  class "fixed6" {
        match if  binary-to-ascii(16, 8, ":", substring(option agent.remote-id, 2, 6)) = "0:11:20:36:8e:c0"
			and	binary-to-ascii (10, 8, "/", suffix ( option agent.circuit-id, 2)) = "0/5";
  }

  pool {
        range 10.1.1.6;
        allow members of "fixed6";
  } 


  class "fixed7" {
        match if  binary-to-ascii(16, 8, ":", substring(option agent.remote-id, 2, 6)) = "0:11:20:36:8e:c0"
			and	binary-to-ascii (10, 8, "/", suffix ( option agent.circuit-id, 2)) = "0/6";
  }

  pool {
        range 10.1.1.7;
        allow members of "fixed7";
  } 

  pool {
	option domain-name-servers bogus.foo.com;
	range 10.1.1.1 10.1.1.4;
	default-lease-time 50000;
  }
}
        
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)),
                " (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("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)));
}  
