option domain-name "ourisp"; option domain-name-servers 172.16.0.1; default-lease-time 3600; max-lease-time 43200; authoritative; ddns-update-style none; log-facility local7; one-lease-per-client true; deny duplicates; shared-network ourisp { {SUBNETS} subnet 192.168.94.0 netmask 255.255.255.0 { } subnet 172.32.0.0 netmask 255.255.240.0 { default-lease-time 3600; option domain-name "isp"; option subnet-mask 255.255.240.0; option domain-name-servers 172.32.0.1; option routers 172.32.0.1; pool { range 172.32.0.100 172.32.0.254; {DENYMEMBERS} } log(info, "=="); if exists agent.remote-id and exists agent.circuit-id { if binary-to-ascii(16, 8, "", substring(option agent.remote-id, 2, 1)) = "0" { set switch-mac = concat("0", binary-to-ascii(16, 8, "", substring(option agent.remote-id, 2, 1)), ":", binary-to-ascii(16, 8, ":", substring(option agent.remote-id, 3, 6))); # log(info,concat("SWITCH-MAC1:",switch-mac)); } else { # set switch-mac = binary-to-ascii(16, 8, ":", substring(option agent.remote-id, 2, 6)); # log(info,concat("SWITCH-MAC2:",switch-mac)); set switch-mac = concat ( suffix (concat ("0", binary-to-ascii (16, 8, "", substring(option agent.remote-id,2,1))),2), ":", suffix (concat ("0", binary-to-ascii (16, 8, "", substring(option agent.remote-id,3,1))),2), ":", suffix (concat ("0", binary-to-ascii (16, 8, "", substring(option agent.remote-id,4,1))),2), ":", suffix (concat ("0", binary-to-ascii (16, 8, "", substring(option agent.remote-id,5,1))),2), ":", suffix (concat ("0", binary-to-ascii (16, 8, "", substring(option agent.remote-id,6,1))),2), ":", suffix (concat ("0", binary-to-ascii (16, 8, "", substring(option agent.remote-id,7,1))),2) ); # log(info,concat("SWITCH-MAC3:",switch-mac3)); } set clip = binary-to-ascii(10,8,".",leased-address); set clremote = binary-to-ascii(16,8,"",option agent.remote-id); set clcircuit = binary-to-ascii(10,8,"",option agent.circuit-id); set switch-port = binary-to-ascii(10, 8, "", substring(option agent.circuit-id, 5, 1)); set switch-port-vlan = binary-to-ascii(10, 16, "", substring(option agent.circuit-id, 2, 2)); log( info,concat("OPTION82 INFO - SWITCHMAC: ",switch-mac," PORTSW: ",switch-port," VLAN: ",switch-port-vlan)); log( info,concat("*Leased IP: ",clip, " SWITCH: ",clremote," PORT: ",clcircuit," SWITCHMAC: ",switch-mac," PORTSW: ",switch-port," VLAN: ",switch-port-vlan," (with opt82)") ); } else { set clhw = concat ( 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) ); log( info,concat("*Leased IP: ",binary-to-ascii(10,8,".",leased-address), " MAC: ", clhw," (without opt82)") ); } log(info, "=="); } }