1
0

dhcpd.conf 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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. log-facility local5;
  17. on commit {
  18. set ClientIP = binary-to-ascii(10, 8, ".", leased-address);
  19. set ClientMac = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6));
  20. set ClientHostName = pick-first-value(option host-name,"undef");
  21. log (info, concat("add;", ClientMac, ";", ClientIP, ";;", ClientHostName,";",binary-to-ascii(10,8,"",suffix (option agent.circuit-id, 1)),";",binary-to-ascii(16,8,":",suffix(option agent.remote-id,6)),";;;"));
  22. }
  23. on release {
  24. set ClientIP = binary-to-ascii(10, 8, ".", leased-address);
  25. set ClientMac = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6));
  26. log (info, concat("del;", ClientMac, ";", ClientIP, ";" , ";undef;;;;;;"));
  27. }
  28. on expiry {
  29. set ClientIP = binary-to-ascii(10, 8, ".", leased-address);
  30. set ClientMac = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6));
  31. log (info, concat("del;", ClientMac, ";", ClientIP, ";" , ";undef;;;;;;"));
  32. }
  33. 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))));
  34. if exists agent.remote-id and exists agent.circuit-id {
  35. log(info,concat("DHCPCIRCUIT for lease of ",binary-to-ascii(10,8,".",leased-address),
  36. " is connected to interface ",binary-to-ascii(10,8,"/",suffix(option agent.circuit-id,2)),
  37. ", VLAN ",binary-to-ascii(10,16,"",substring(suffix(option agent.circuit-id,4),0,2)),
  38. " on switch ",binary-to-ascii(16,8,":",suffix(option agent.remote-id,6))
  39. ));
  40. log(info,concat("DHCPOPT82 for lease of ",binary-to-ascii(10,8,".",leased-address),
  41. " raw option-82 info is CID: ",binary-to-ascii(10,8,".",option agent.circuit-id),
  42. " AID: ",binary-to-ascii(16,8,".",option agent.remote-id)
  43. ));
  44. } elsif exists agent.remote-id {
  45. log(info,concat("DHCPAGENT for lease of ",binary-to-ascii(10,8,".",leased-address),
  46. " on agent ",binary-to-ascii(16,8,":",substring(option agent.remote-id, 2, 6))
  47. ));
  48. } elsif exists agent.circuit-id {
  49. log(info,concat("DHCPCIRCUITID on ",
  50. suffix(concat("0",binary-to-ascii(16,8,"",substring(hardware,1,1))),2),":",
  51. suffix(concat("0",binary-to-ascii(16,8,"",substring(hardware,2,1))),2),":",
  52. suffix(concat("0",binary-to-ascii(16,8,"",substring(hardware,3,1))),2),":",
  53. suffix(concat("0",binary-to-ascii(16,8,"",substring(hardware,4,1))),2),":",
  54. suffix(concat("0",binary-to-ascii(16,8,"",substring(hardware,5,1))),2),":",
  55. suffix(concat("0",binary-to-ascii(16,8,"",substring(hardware,6,1))),2),
  56. " to ",binary-to-ascii(10,8,".",leased-address),
  57. " via ",option agent.circuit-id
  58. ));
  59. }
  60. option ms-classless-static-routes code 249 = array of unsigned integer 8;
  61. option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;
  62. # WPAD definition
  63. option wpad code 252 = text;
  64. # Suppress WPAD activity - no cache, no DNS.
  65. option wpad "\n\000";
  66. option space MSFT;
  67. #release ip if shutdown
  68. option MSFT.release-on-shutdown code 2 = unsigned integer 32;
  69. class "MSFT" {
  70. match if substring(option vendor-class-identifier, 0, 4) = "MSFT";
  71. # They put 252 on the DHCPINFORM's, but not on the DHCPREQUEST's
  72. # PRL. So we over-ride the PRL to include 252 = 0xFC, which will also
  73. # suppress the DHCPINFORMS!
  74. option dhcp-parameter-request-list =
  75. concat(option dhcp-parameter-request-list, fc);
  76. # Make DHCP work on dual boot machines (Linux & Windows2000)
  77. # Microsoft proprietary stuff:
  78. send fqdn.server-update true;
  79. send fqdn.no-client-update true;
  80. vendor-option-space MSFT;
  81. option MSFT.release-on-shutdown 1;
  82. }
  83. class "default" {
  84. match if (binary-to-ascii (10, 16, "", substring ( option agent.circuit-id, 2, 2 ) ) = "99");
  85. }
  86. class "any" {
  87. match if (not exists agent.circuit-id);
  88. }
  89. class "direct" {
  90. match if (binary-to-ascii(10,8,".",packet (24,4)) = "0.0.0.0");
  91. }
  92. include "/etc/dhcp/eye.d/eye.conf";