From eecec6b5caeaef14a03ddbb1d09f9c599273b998 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sun, 6 Dec 2020 13:44:56 +0100 Subject: 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 --- data/templates/dhcp-server/dhcpd.conf.tmpl | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'data/templates') 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 %} -- cgit v1.2.3