dhcpd.conf 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #
  2. # Gateway DHCP server configuration (Salt managed)
  3. #
  4. {%- set sites = salt['pillar.get']('sites', {}) %}
  5. {%- set te = salt['pillar.get']('te', {}) %}
  6. {%- set node_config = salt['pillar.get']('nodes:' ~ grains['id']) %}
  7. {%- set te_prefixes = salt['ffho_net.get_te_prefixes'](te, grains['id'], 'v4') %}
  8. # The ddns-updates-style parameter controls whether or not the server will
  9. # attempt to do a DNS update when a lease is confirmed. We default to the
  10. # behavior of the version 2 packages ('none', since DHCP v2 didn't
  11. # have support for DDNS.)
  12. ddns-update-style none;
  13. log-facility local7;
  14. default-lease-time 600;
  15. max-lease-time 3600;
  16. # Use Anycast DNS server(s)
  17. option domain-name-servers 10.132.251.53;
  18. {% for site in node_config.get ('sites', [])|sort %}
  19. {%- set site_config = sites.get (site) %}
  20. {%- set site_prefix = site_config.get ('prefix_v4') %}
  21. {%- set brige_ips = salt['ffho_net.get_node_iface_ips'] (node_config, 'br-' ~ site) %}
  22. # {{ site }} / {{ site_config.get ('name') }}
  23. subnet {{ site_prefix.split ('/')[0] }} netmask {{ salt['ffho_net.cidr_to_dotted_mask'](site_prefix) }} {
  24. pool {
  25. # monitor: 75% 90% Y {{ grains['nodename'] }}/{{ site }} DHCP pool
  26. # Use our own IP as gateway for our clients
  27. option routers {{ brige_ips['v4'][0] }};
  28. # Range(s) of IPs to lease to clients
  29. {%- for prefix in te_prefixes|sort %}
  30. {%- if salt['ffho_net.is_subprefix'] (site_prefix, prefix) %}
  31. {%- set prefix_config = te_prefixes.get (prefix) %}
  32. {%- if 'dhcp_range' in prefix_config %}
  33. range {{ prefix_config.get ('dhcp_range') }};
  34. {%- endif %}
  35. {%- endif %}
  36. {%- endfor %}
  37. }
  38. }
  39. {% endfor %}
  40. ################################################################################
  41. # Static DHCP binding for IPs with the mesh #
  42. ################################################################################
  43. host suche {
  44. hardware ethernet b8:27:eb:01:ca:73;
  45. fixed-address 10.132.3.110;
  46. }
  47. host minetest {
  48. hardware ethernet b8:27:eb:96:17:fb;
  49. fixed-address 10.132.3.111;
  50. }
  51. host zockerbude {
  52. hardware ethernet 1e:f6:d7:28:a7:76;
  53. fixed-address 10.132.3.112;
  54. }
  55. # RaspPi spiegelt Wikipedia + das Ubuntuuser Wiki (bitpage)
  56. host wissen {
  57. hardware ethernet b8:27:eb:c4:f5:d8;
  58. fixed-address 10.132.3.114;
  59. }
  60. # rPi von davediehose, spiegelt OpenWRT repo und Zeuch
  61. host davesrv {
  62. hardware ethernet b8:27:eb:50:36:6f;
  63. fixed-address 10.132.3.115;
  64. }
  65. host mumble {
  66. hardware ethernet b8:27:eb:44:c4:68;
  67. fixed-address 10.132.3.116;
  68. }