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 11:58:19 +0200
commit6c2c089c26f1652644c9ded7d5cfd8a0497f148e (patch)
tree8a0969681d67337c18a268b83f9c27e32137b07b /data/templates/dhcp-server/dhcpd.conf.tmpl
parent2985035bcb2f3732e15a41e3c2ee6c6c93a6836e (diff)
downloadvyos-1x-6c2c089c26f1652644c9ded7d5cfd8a0497f148e.tar.gz
vyos-1x-6c2c089c26f1652644c9ded7d5cfd8a0497f148e.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.
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 790f57bbb..d774b4827 100644
--- a/data/templates/dhcp-server/dhcpd.conf.tmpl
+++ b/data/templates/dhcp-server/dhcpd.conf.tmpl
@@ -182,7 +182,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;
@@ -192,7 +195,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 %}