summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-03-08 20:26:33 +0100
committerChristian Poessinger <christian@poessinger.com>2019-03-17 15:54:57 +0100
commitdfe130541ccdd3c8fdedd90b9ef4762f6babd5c6 (patch)
tree6647078a00177a2a797763e9c6a7ae4b66a1cb89 /src/conf_mode
parentd17f30a5002bc2ca6c65d486b917fbd8034fdcaf (diff)
downloadvyos-1x-dfe130541ccdd3c8fdedd90b9ef4762f6babd5c6.tar.gz
vyos-1x-dfe130541ccdd3c8fdedd90b9ef4762f6babd5c6.zip
T103: [dhcp-server] add support to configure host declarative names
(cherry picked from commit 0fefe3c3b9250ad2ba841287a94036119728c708)
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/dhcp_server.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/conf_mode/dhcp_server.py b/src/conf_mode/dhcp_server.py
index 22ada72a8..bbe0bf28a 100755
--- a/src/conf_mode/dhcp_server.py
+++ b/src/conf_mode/dhcp_server.py
@@ -58,6 +58,9 @@ on expiry {
execute("/usr/libexec/vyos/system/on-dhcp-event.sh", "release", ClientName, ClientIp, ClientMac, ClientDomain);
}
{% endif %}
+{%- if host_decl_name %}
+use-host-decl-names on;
+{%- endif %}
ddns-update-style {% if ddns_enable -%} interim {%- else -%} none {%- endif %};
{% if static_route -%}
option rfc3442-static-route code 121 = array of integer 8;
@@ -240,6 +243,7 @@ default_config_data = {
'ddns_enable': False,
'global_parameters': [],
'hostfile_update': False,
+ 'host_decl_name': False,
'static_route': False,
'wpad': False,
'shared_network': [],
@@ -272,6 +276,11 @@ def get_config():
if conf.exists('hostfile-update'):
dhcp['hostfile_update'] = True
+ # If enabled every host declaration within that scope, the name provided
+ # for the host declaration will be supplied to the client as its hostname.
+ if conf.exists('host-decl-name'):
+ dhcp['host_decl_name'] = True
+
# check for multiple, shared networks served with DHCP addresses
if conf.exists('shared-network-name'):
for network in conf.list_nodes('shared-network-name'):