summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-10-08 21:39:45 +0200
committerChristian Poessinger <christian@poessinger.com>2019-10-09 17:19:04 +0200
commit2d3539f9dec19c0d5cec5bd962aaf9640a8cec23 (patch)
treee367413c11d8f522454352712a9446fe258adc84 /python
parentafc82770cce851da31267829f1726f85093d9d76 (diff)
downloadvyos-1x-2d3539f9dec19c0d5cec5bd962aaf9640a8cec23.tar.gz
vyos-1x-2d3539f9dec19c0d5cec5bd962aaf9640a8cec23.zip
T1430: add dhcp vendor-class-id client option
Diffstat (limited to 'python')
-rw-r--r--python/vyos/configdict.py5
-rw-r--r--python/vyos/ifconfig.py4
2 files changed, 9 insertions, 0 deletions
diff --git a/python/vyos/configdict.py b/python/vyos/configdict.py
index 1c9cf6897..1022b88de 100644
--- a/python/vyos/configdict.py
+++ b/python/vyos/configdict.py
@@ -112,6 +112,7 @@ def vlan_to_dict(conf):
'description': '',
'dhcp_client_id': '',
'dhcp_hostname': '',
+ 'dhcp_vendor_class_id': '',
'dhcpv6_prm_only': False,
'dhcpv6_temporary': False,
'disable': False,
@@ -145,6 +146,10 @@ def vlan_to_dict(conf):
if conf.exists('dhcp-options host-name'):
vlan['dhcp_hostname'] = conf.return_value('dhcp-options host-name')
+ # DHCP client vendor identifier
+ if conf.exists('dhcp-options vendor-class-id'):
+ vlan['dhcp_vendor_class_id'] = conf.return_value('dhcp-options vendor-class-id')
+
# DHCPv6 only acquire config parameters, no address
if conf.exists('dhcpv6-options parameters-only'):
vlan['dhcpv6_prm_only'] = conf.return_value('dhcpv6-options parameters-only')
diff --git a/python/vyos/ifconfig.py b/python/vyos/ifconfig.py
index 0f80f4cea..23e66c089 100644
--- a/python/vyos/ifconfig.py
+++ b/python/vyos/ifconfig.py
@@ -35,6 +35,9 @@ interface "{{ intf }}" {
{% if client_id -%}
send dhcp-client-identifier "{{ client_id }}";
{% endif -%}
+ {% if vendor_class_id -%}
+ send vendor-class-identifier "{{ vendor_class_id }}";
+ {% endif -%}
request subnet-mask, broadcast-address, routers, domain-name-servers,
rfc3442-classless-static-routes, domain-name, interface-mtu;
require subnet-mask;
@@ -91,6 +94,7 @@ class Interface:
'intf' : self._ifname,
'hostname' : '',
'client_id' : '',
+ 'vendor_class_id' : ''
}
def _debug_msg(self, msg):