aboutsummaryrefslogtreecommitdiffstats
path: root/roles/space_server/templates/dhcpd.conf.j2
diff options
context:
space:
mode:
Diffstat (limited to 'roles/space_server/templates/dhcpd.conf.j2')
-rw-r--r--roles/space_server/templates/dhcpd.conf.j253
1 files changed, 53 insertions, 0 deletions
diff --git a/roles/space_server/templates/dhcpd.conf.j2 b/roles/space_server/templates/dhcpd.conf.j2
index 23e08da..8e02112 100644
--- a/roles/space_server/templates/dhcpd.conf.j2
+++ b/roles/space_server/templates/dhcpd.conf.j2
@@ -8,7 +8,30 @@
# attempt to do a DNS update when a lease is confirmed. We default to the
# behavior of the version 2 packages ('none', since DHCP v2 didn't
# have support for DDNS.)
+{% if ddns_secret is defined %}
+ddns-update-style interim;
+ddns-local-address4 127.0.0.1;
+ddns-local-address6 ::1;
+
+key dhcpupdate {
+ algorithm {{ ddns_secret.algorithm }};
+ secret {{ ddns_secret.key }};
+}
+
+zone dhcp. {
+ primary 127.0.0.1;
+ primary6 ::1;
+ key dhcpupdate;
+}
+
+zone 42.10.in-addr.arpa. {
+ primary 127.0.0.1;
+ primary6 ::1;
+ key dhcpupdate;
+}
+{% else %}
ddns-update-style none;
+{% endif %}
# option definitions common to all supported networks...
#option domain-name "labitat.dk";
@@ -35,6 +58,7 @@ subnet 10.42.0.0 netmask 255.255.255.0 {
option routers 10.42.0.1;
option domain-name-servers 185.38.175.0;
#option ntp-servers 90.185.0.18;
+ ddns-updates off;
deny bootp;
allow duplicates;
@@ -52,6 +76,13 @@ subnet 10.42.1.0 netmask 255.255.255.0 {
next-server 10.42.1.1;
filename "pxelinux.0";
+ if exists host-name {
+ ddns-hostname = option host-name;
+ ddns-domainname "dhcp";
+ } else {
+ ddns-updates off;
+ }
+
allow bootp;
allow duplicates;
allow declines;
@@ -68,6 +99,13 @@ subnet 10.42.2.0 netmask 255.255.255.0 {
next-server 10.42.2.1;
filename "pxelinux.0";
+ if exists host-name {
+ ddns-hostname = option host-name;
+ ddns-domainname "dhcp";
+ } else {
+ ddns-updates off;
+ }
+
allow bootp;
allow duplicates;
allow declines;
@@ -82,6 +120,13 @@ subnet 10.42.3.0 netmask 255.255.255.0 {
option domain-name-servers 185.38.175.0;
#option ntp-servers 90.185.0.18;
+ if exists host-name {
+ ddns-hostname = option host-name;
+ ddns-domainname "dhcp";
+ } else {
+ ddns-updates off;
+ }
+
allow bootp;
allow duplicates;
deny declines;
@@ -96,6 +141,13 @@ subnet 10.42.3.0 netmask 255.255.255.0 {
# option domain-name-servers 185.38.175.0;
# #option ntp-servers 90.185.0.18;
#
+# if exists host-name {
+# ddns-hostname = option host-name;
+# ddns-domainname "dhcp";
+# } else {
+# ddns-updates off;
+# }
+#
# allow bootp;
# allow duplicates;
# allow declines;
@@ -104,6 +156,7 @@ subnet 10.42.3.0 netmask 255.255.255.0 {
group {
use-host-decl-names on;
+ ddns-updates off;
{% for host in local_hosts %}
{% if 'mac' in host and 'ipv4' in host %}