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 3.2KB

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