summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorViacheslav <v.gletenko@vyos.io>2021-10-14 12:35:17 +0000
committerViacheslav <v.gletenko@vyos.io>2021-10-15 17:28:37 +0000
commit70836c5adb4e51bf46f79700b57b9a1437776793 (patch)
tree3572719343f048b6c181db7ac6595632aa83a304 /data
parentd4c5e78fc94a375487a968083f88d96323b67301 (diff)
downloadvyos-1x-70836c5adb4e51bf46f79700b57b9a1437776793.tar.gz
vyos-1x-70836c5adb4e51bf46f79700b57b9a1437776793.zip
dhclient: T3832: Add hexadecimal format for client-id
The hedadecimal option dhcp-cliend-identifier format is required to set values without quotes, separated by colons.
Diffstat (limited to 'data')
-rw-r--r--data/templates/dhcp-client/ipv4.tmpl7
1 files changed, 6 insertions, 1 deletions
diff --git a/data/templates/dhcp-client/ipv4.tmpl b/data/templates/dhcp-client/ipv4.tmpl
index c934b7cdb..11e961166 100644
--- a/data/templates/dhcp-client/ipv4.tmpl
+++ b/data/templates/dhcp-client/ipv4.tmpl
@@ -7,7 +7,12 @@ retry 300;
interface "{{ ifname }}" {
send host-name "{{ dhcp_options.host_name }}";
{% if dhcp_options.client_id is defined and dhcp_options.client_id is not none %}
- send dhcp-client-identifier "{{ dhcp_options.client_id }}";
+{% set client_id = dhcp_options.client_id %}
+{# Use HEX representation of client-id as it is send in MAC-address style using hex characters. If not HEX, use double quotes ASCII format #}
+{% if not dhcp_options.client_id.split(':') | length >= 5 %}
+{% set client_id = '"' + dhcp_options.client_id + '"' %}
+{% endif %}
+ send dhcp-client-identifier {{ client_id }};
{% endif %}
{% if dhcp_options.vendor_class_id is defined and dhcp_options.vendor_class_id is not none %}
send vendor-class-identifier "{{ dhcp_options.vendor_class_id }}";