summaryrefslogtreecommitdiff
path: root/data/templates
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-12-06 13:44:56 +0100
committerChristian Poessinger <christian@poessinger.com>2020-12-06 13:44:56 +0100
commiteecec6b5caeaef14a03ddbb1d09f9c599273b998 (patch)
tree577090ffd8f2f495a49d02c36c91dbd853c7e514 /data/templates
parentb83c988a1390efc6f7d881fa9cc06eddb825f827 (diff)
downloadvyos-1x-eecec6b5caeaef14a03ddbb1d09f9c599273b998.tar.gz
vyos-1x-eecec6b5caeaef14a03ddbb1d09f9c599273b998.zip
dhcp: T2562: add "listen-address" CLI node for better DHCP relay support
Running ISC DHCP server as backend server for multiple pools served to relay agents requires DHCPd to explicitly listen on give interfaces or a "transit" subnet declaration facing the network where we receive the DHCPREQ messages on. This implements a new "listen-address" CLI node, the given address is validated if it is assigned to the system and upon success, a proper "subnet { }" statement is added into dhcpd.conf
Diffstat (limited to 'data/templates')
-rw-r--r--data/templates/dhcp-server/dhcpd.conf.tmpl8
1 files changed, 8 insertions, 0 deletions
diff --git a/data/templates/dhcp-server/dhcpd.conf.tmpl b/data/templates/dhcp-server/dhcpd.conf.tmpl
index bcf425abd..56a5f4bcd 100644
--- a/data/templates/dhcp-server/dhcpd.conf.tmpl
+++ b/data/templates/dhcp-server/dhcpd.conf.tmpl
@@ -62,6 +62,14 @@ failover peer "{{ subnet_config.failover.name }}" {
{% endif %}
{% endfor %}
{% endif %}
+{% if listen_address is defined and listen_address is not none %}
+
+# DHCP server serving relay subnet, we need a connector to the real world
+{% for address in listen_address %}
+# Connected subnet statement for listen-address {{ address }}
+subnet {{ address | network_from_ipv4 }} netmask {{ address | netmask_from_ipv4 }} { }
+{% endfor %}
+{% endif %}
# Shared network configration(s)
{% if shared_network_name is defined and shared_network_name is not none %}