dhcpd.conf.j2 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. # {{ ansible_managed }}
  2. #
  3. # DHCP Server Configuration file.
  4. # see /usr/share/doc/dhcp*/dhcpd.conf.example
  5. # see dhcpd.conf(5) man page
  6. #
  7. authoritative;
  8. default-lease-time 43200; # 12 hours
  9. max-lease-time 86400; # 24 hours
  10. option rfc3442-classless-static-routes code 121 = array of integer 8;
  11. option ms-classless-static-routes code 249 = array of integer 8;
  12. option rfc3442-classless-static-routes 24, 192, 168, 1, 10, 0, 0, 8, 0, 10, 0, 0, 1;
  13. option ms-classless-static-routes 24, 192, 168, 1, 10, 0, 0, 8, 0, 10, 0, 0, 1;
  14. subnet {{ dhcp_cidr }} netmask {{ dhcp_netmask }} {
  15. option routers {{ dhcp_default_gateway }};
  16. option domain-name-servers {{ dhcp_secure_gateway }}, {{ dns_primary }}, {{ dns_secondary }};
  17. option domain-name "home.arpa";
  18. ## WINS info for Windows capability
  19. #option netbios-name-servers 10.0.0.4;
  20. #option netbios-node-type 8;
  21. # Dynamic IPs
  22. range {{ dhcp_range_start }} {{ dhcp_range_end }};
  23. class "secured" {
  24. option routers {{ dhcp_secure_gateway }};
  25. # 192.168.1.0/24 thru 10.0.0.8, 10.0.0.2 as default route
  26. #option rfc3442-classless-static-routes 24, 192, 168, 1, 10, 0, 0, 8, 0, 10, 0, 0, 2;
  27. option rfc3442-classless-static-routes 24, 192, 168, 1, 10, 0, 0, 8, 0, 10, 0, 0, 2;
  28. option ms-classless-static-routes 24, 192, 168, 1, 10, 0, 0, 8, 0, 10, 0, 0, 2;
  29. match hardware;
  30. }
  31. class "cloudflare" {
  32. option domain-name-servers 1.1.1.3, 1.0.0.3; # cloudflare block malware + porn
  33. match hardware;
  34. }
  35. class "devnull" {
  36. option domain-name-servers 127.0.0.1;
  37. match hardware;
  38. }
  39. # nothing in here (yet)
  40. class "default" {
  41. match hardware;
  42. }
  43. {% for node in reservations %}
  44. subclass "{{ node.type }}" 1:{{ node.mac }}; # {{ node.name }}
  45. {% endfor %}
  46. {% for node in reservations %}
  47. host {{ node.name }}
  48. {
  49. hardware ethernet {{ node.mac }};
  50. fixed-address {{ node.ip }};
  51. }
  52. {% endfor %}
  53. }