You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

dhcpd.conf 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. #Dynamic DNS security settings
  2. key "key-internal" {
  3. algorithm HMAC-MD5;
  4. secret "DNS_TSIG_KEY_INTERNAL_SECRET";
  5. };
  6. zone DHCP_DYN_IPS_DOMAIN {
  7. primary DHCP_DNS_MASTER;
  8. key "key-internal";
  9. }
  10. zone DHCP_SITE_DOMAIN {
  11. primary DHCP_DNS_MASTER;
  12. key "key-internal";
  13. }
  14. zone DHCP_REV_DOMAIN {
  15. primary DHCP_DNS_MASTER;
  16. key "key-internal";
  17. }
  18. # Custom routes classes
  19. option classless-routes code 121 = array of unsigned integer 8;
  20. option classless-routes-win code 249 = array of unsigned integer 8;
  21. # UniFi classes
  22. option space ubnt;
  23. option ubnt.unifi-address code 1 = ip-address;
  24. class "ubnt" {
  25. match if substring (option vendor-class-identifier, 0, 4) = "ubnt";
  26. option vendor-class-identifier "ubnt";
  27. vendor-option-space ubnt;
  28. }
  29. # Leases settings
  30. default-lease-time 600;
  31. max-lease-time 7200;
  32. # Dynamic DNS update
  33. ddns-updates on;
  34. ddns-update-style interim;
  35. update-static-leases on;
  36. #allow client-updates;
  37. # Misc settings
  38. use-host-decl-names on;
  39. authoritative;
  40. log-facility local7;
  41. subnet DHCP_SUBNET netmask DHCP_NETMASK {
  42. # Dynamic DNS update
  43. ddns-domainname "DHCP_DYN_IPS_DOMAIN";
  44. update-conflict-detection false;
  45. # IP settings
  46. range DHCP_IP_FIRST DHCP_IP_LAST;
  47. option subnet-mask DHCP_NETMASK;
  48. option broadcast-address DHCP_BROADCAST;
  49. option routers DHCP_ROUTERS;
  50. # UniFi settings
  51. option ubnt.unifi-address DHCP_UNIFI_CONTROLLER_IP;
  52. # DNS settings
  53. option domain-name "DHCP_SITE_DOMAIN";
  54. option domain-search "DHCP_SITE_DOMAIN", "DHCP_DOMAIN", "DHCP_DYN_IPS_DOMAIN";
  55. option domain-name-servers DHCP_DNS_SERVERS;
  56. # Push custom routes to clients
  57. #option classless-routes 24, 10,15,42, 10.15.12,2;
  58. #option classless-routes-win 24, 10,15,42, 10.15.12,2;
  59. # Netboot settings
  60. next-server DHCP_TFTP_SERVER;
  61. #option root-path "10.15.100.1:/pxeroot/ubuntu";
  62. if exists user-class and ( option user-class = "iPXE-rthoni" ) {
  63. option domain-search "DHCP_SITE_DOMAIN";
  64. filename "http://netboot/boot.ipxe";
  65. }
  66. else {
  67. filename "ipxe-rthoni.kpxe";
  68. }
  69. # Static IP hosts
  70. group {
  71. include "/etc/dhcp/config/static_ips.conf";
  72. ddns-domainname "DHCP_SITE_DOMAIN";
  73. option host-name = host-decl-name;
  74. ddns-hostname = config-option host-name;
  75. }
  76. # Force a default hostname if not present
  77. if option dhcp-message-type = 3 and not exists host-name and config-option host-name = null {
  78. option host-name = concat("dyn-", binary-to-ascii(10, 8, "-", leased-address));
  79. ddns-hostname = config-option host-name;
  80. }
  81. }