dhcpd.conf 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. option domain-name "lan.local";
  2. option domain-name-servers <NS1>, <NS2>;
  3. default-lease-time 28800;
  4. max-lease-time 86400;
  5. ddns-update-style none;
  6. ddns-updates off;
  7. one-lease-per-client true;
  8. authoritative;
  9. allow booting;
  10. allow bootp;
  11. log-facility local7;
  12. option log-servers <STAT>;
  13. option ntp-servers <NTP>;
  14. use-host-decl-names off;
  15. ping-check false;
  16. on commit {
  17. set ClientIP = binary-to-ascii(10, 8, ".", leased-address);
  18. set ClientMac = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6));
  19. set ClientHostName = pick-first-value(option host-name,"undef");
  20. execute("/usr/local/scripts/dhcp-hook.sh", "add", ClientIP, ClientMac, ClientHostName);
  21. }
  22. on release {
  23. set ClientIP = binary-to-ascii(10, 8, ".", leased-address);
  24. set ClientMac = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6));
  25. execute("/usr/local/scripts/dhcp-hook.sh", "del", ClientIP, ClientMac);
  26. }
  27. on expiry {
  28. set ClientIP = binary-to-ascii(10, 8, ".", leased-address);
  29. set ClientMac = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6));
  30. execute("/usr/local/scripts/dhcp-hook.sh", "del", ClientIP, ClientMac);
  31. }
  32. log (info, concat("DHCPDLOG - ",binary-to-ascii(10, 8, ".", leased-address)," - ",pick-first-value(option host-name,"undef")," - ",binary-to-ascii (16, 8, ":", substring(hardware, 1, 7))," - at switch - ",binary-to-ascii(16,8,":",suffix(option agent.remote-id,6))," - vlan - ",binary-to-ascii(10,16,"",substring(suffix(option agent.circuit-id,4),0,2))," - port - ",binary-to-ascii(10,8,"",suffix (option agent.circuit-id, 1))," - via - ",binary-to-ascii(10,8,".",packet (24,4))));
  33. # WPAD definition
  34. option wpad code 252 = text;
  35. # Suppress WPAD activity - no cache, no DNS.
  36. option wpad "\n\000";
  37. option space MSFT;
  38. #release ip if shutdown
  39. option MSFT.release-on-shutdown code 2 = unsigned integer 32;
  40. class "MSFT" {
  41. match if substring(option vendor-class-identifier, 0, 4) = "MSFT";
  42. # They put 252 on the DHCPINFORM's, but not on the DHCPREQUEST's
  43. # PRL. So we over-ride the PRL to include 252 = 0xFC, which will also
  44. # suppress the DHCPINFORMS!
  45. option dhcp-parameter-request-list =
  46. concat(option dhcp-parameter-request-list, fc);
  47. # Make DHCP work on dual boot machines (Linux & Windows2000)
  48. # Microsoft proprietary stuff:
  49. send fqdn.server-update true;
  50. send fqdn.no-client-update true;
  51. vendor-option-space MSFT;
  52. option MSFT.release-on-shutdown 1;
  53. }
  54. shared-network "company" {
  55. #office
  56. subnet 192.168.1.0 netmask 255.255.255.0 {
  57. option routers 192.168.1.1;
  58. authoritative;
  59. include "/etc/dhcp/stat/192.168.1.0.conf";
  60. }
  61. }