summaryrefslogtreecommitdiff
path: root/data/templates/dhcp-server/dhcpd.conf.tmpl
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-09-19 11:58:19 +0200
committerChristian Poessinger <christian@poessinger.com>2021-09-19 12:28:56 +0200
commit8f3fe8cc5db13e2fa5ef6f0a962546087a6fa6d8 (patch)
tree9b528ebd456c6a681c8bb609357808579e37e4b1 /data/templates/dhcp-server/dhcpd.conf.tmpl
parenta00f3bfd0ff580625f63f024bdce9ed55100d63d (diff)
downloadvyos-1x-8f3fe8cc5db13e2fa5ef6f0a962546087a6fa6d8.tar.gz
vyos-1x-8f3fe8cc5db13e2fa5ef6f0a962546087a6fa6d8.zip
dhcp-server: T3672: bugfix Jinja2 template
The DHCP servers pool {} option can only be used when there follows a range statement. This is invalid for a network with only "static" leases. (cherry picked from commit 6c2c089c26f1652644c9ded7d5cfd8a0497f148e)
Diffstat (limited to 'data/templates/dhcp-server/dhcpd.conf.tmpl')
-rw-r--r--data/templates/dhcp-server/dhcpd.conf.tmpl6
1 files changed, 6 insertions, 0 deletions
diff --git a/data/templates/dhcp-server/dhcpd.conf.tmpl b/data/templates/dhcp-server/dhcpd.conf.tmpl
index 11482c1ec..7173986a4 100644
--- a/data/templates/dhcp-server/dhcpd.conf.tmpl
+++ b/data/templates/dhcp-server/dhcpd.conf.tmpl
@@ -180,7 +180,10 @@ shared-network {{ network | replace('_','-') }} {
}
{% endfor %}
{% endif %}
+{% if subnet_config.range is defined and subnet_config.range is not none %}
+{# pool configuration can only be used if there follows a range option #}
pool {
+{% endif %}
{% if subnet_config.enable_failover is defined %}
failover peer "{{ failover.name }}";
deny dynamic bootp clients;
@@ -190,7 +193,10 @@ shared-network {{ network | replace('_','-') }} {
range {{ range_options.start }} {{ range_options.stop }};
{% endfor %}
{% endif %}
+{% if subnet_config.range is defined and subnet_config.range is not none %}
+{# pool configuration can only be used if there follows a range option #}
}
+{% endif %}
}
{% endfor %}
{% endif %}