dhcpd.conf 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. {%- set prefix_config = te_prefixes.get (prefix) %}
  31. {%- if 'dhcp_range' in prefix_config %}
  32. range {{ prefix_config.get ('dhcp_range') }};
  33. {%- endif %}
  34. {%- endfor %}
  35. }
  36. }
  37. {% endfor %}
  38. ################################################################################
  39. # Static DHCP binding for IPs with the mesh #
  40. ################################################################################
  41. host suche {
  42. hardware ethernet b8:27:eb:01:ca:73;
  43. fixed-address 10.132.3.110;
  44. }
  45. host minetest {
  46. hardware ethernet b8:27:eb:96:17:fb;
  47. fixed-address 10.132.3.111;
  48. }
  49. host zockerbude {
  50. hardware ethernet 1e:f6:d7:28:a7:76;
  51. fixed-address 10.132.3.112;
  52. }
  53. # RaspPi spiegelt Wikipedia + das Ubuntuuser Wiki (bitpage)
  54. host wissen {
  55. hardware ethernet b8:27:eb:c4:f5:d8;
  56. fixed-address 10.132.3.114;
  57. }
  58. # rPi von davediehose, spiegelt OpenWRT repo und Zeuch
  59. host davesrv {
  60. hardware ethernet b8:27:eb:50:36:6f;
  61. fixed-address 10.132.3.115;
  62. }
  63. host mumble {
  64. hardware ethernet b8:27:eb:44:c4:68;
  65. fixed-address 10.132.3.116;
  66. }