summaryrefslogtreecommitdiff
path: root/src/conf_mode/interface-bridge.py
diff options
context:
space:
mode:
authorhagbard <vyosdev@derith.de>2019-10-09 09:29:29 -0700
committerhagbard <vyosdev@derith.de>2019-10-09 09:29:29 -0700
commit9b5867b7345e14cd7b738b51ae5b17a524e461f5 (patch)
treeb72d2c335fefd3e1111bb406e2c35fd261a8c7de /src/conf_mode/interface-bridge.py
parentf8be18fbc549bc574746991bd0bb1de9b424745e (diff)
parent2d3539f9dec19c0d5cec5bd962aaf9640a8cec23 (diff)
downloadvyos-1x-9b5867b7345e14cd7b738b51ae5b17a524e461f5.tar.gz
vyos-1x-9b5867b7345e14cd7b738b51ae5b17a524e461f5.zip
Merge branch 'current' into equuleus
Diffstat (limited to 'src/conf_mode/interface-bridge.py')
-rwxr-xr-xsrc/conf_mode/interface-bridge.py41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/conf_mode/interface-bridge.py b/src/conf_mode/interface-bridge.py
index 37b5c4979..57ac98444 100755
--- a/src/conf_mode/interface-bridge.py
+++ b/src/conf_mode/interface-bridge.py
@@ -32,6 +32,11 @@ default_config_data = {
'arp_cache_tmo': 30,
'description': '',
'deleted': False,
+ 'dhcp_client_id': '',
+ 'dhcp_hostname': '',
+ 'dhcp_vendor_class_id': '',
+ 'dhcpv6_prm_only': False,
+ 'dhcpv6_temporary': False,
'disable': False,
'disable_link_detect': 1,
'forwarding_delay': 14,
@@ -81,6 +86,26 @@ def get_config():
if conf.exists('description'):
bridge['description'] = conf.return_value('description')
+ # get DHCP client identifier
+ if conf.exists('dhcp-options client-id'):
+ bridge['dhcp_client_id'] = conf.return_value('dhcp-options client-id')
+
+ # DHCP client host name (overrides the system host name)
+ if conf.exists('dhcp-options host-name'):
+ bridge['dhcp_hostname'] = conf.return_value('dhcp-options host-name')
+
+ # DHCP client vendor identifier
+ if conf.exists('dhcp-options vendor-class-id'):
+ bridge['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'):
+ bridge['dhcpv6_prm_only'] = conf.return_value('dhcpv6-options parameters-only')
+
+ # DHCPv6 temporary IPv6 address
+ if conf.exists('dhcpv6-options temporary'):
+ bridge['dhcpv6_temporary'] = conf.return_value('dhcpv6-options temporary')
+
# Disable this bridge interface
if conf.exists('disable'):
bridge['disable'] = True
@@ -203,6 +228,22 @@ def apply(bridge):
# update interface description used e.g. within SNMP
br.set_alias(bridge['description'])
+ # get DHCP config dictionary and update values
+ opt = br.get_dhcp_options()
+
+ if bridge['dhcp_client_id']:
+ opt['client_id'] = bridge['dhcp_client_id']
+
+ if bridge['dhcp_hostname']:
+ opt['hostname'] = bridge['dhcp_hostname']
+
+ if bridge['dhcp_vendor_class_id']:
+ opt['vendor_class_id'] = bridge['dhcp_vendor_class_id']
+
+ # store DHCP config dictionary - used later on when addresses
+ # are requested
+ br.set_dhcp_options(opt)
+
# Change interface MAC address
if bridge['mac']:
br.set_mac(bridge['mac'])