summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-10-13 12:31:40 +0200
committerChristian Poessinger <christian@poessinger.com>2019-10-13 12:31:40 +0200
commit177de5378a1e9e6983e34ef4a5244310b78d870a (patch)
tree01690020455a418462ead14eeb11600bb51b4ede /src/conf_mode
parentcdfe017ea6bfc7d4306d9e73c44f40671f41fdbc (diff)
downloadvyos-1x-177de5378a1e9e6983e34ef4a5244310b78d870a.tar.gz
vyos-1x-177de5378a1e9e6983e34ef4a5244310b78d870a.zip
bonding: T1614: support DHCP options on VLAN interfaces
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/interface-bonding.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/conf_mode/interface-bonding.py b/src/conf_mode/interface-bonding.py
index c299744fe..19817da8d 100755
--- a/src/conf_mode/interface-bonding.py
+++ b/src/conf_mode/interface-bonding.py
@@ -84,6 +84,21 @@ def apply_vlan_config(vlan, config):
if type(vlan) != type(VLANIf("lo")):
raise TypeError()
+ # get DHCP config dictionary and update values
+ opt = vlan.get_dhcp_options()
+
+ if config['dhcp_client_id']:
+ opt['client_id'] = config['dhcp_client_id']
+
+ if config['dhcp_hostname']:
+ opt['hostname'] = config['dhcp_hostname']
+
+ if config['dhcp_vendor_class_id']:
+ opt['vendor_class_id'] = config['dhcp_vendor_class_id']
+
+ # store DHCP config dictionary - used later on when addresses are aquired
+ vlan.set_dhcp_options(opt)
+
# update interface description used e.g. within SNMP
vlan.set_alias(config['description'])
# ignore link state changes
@@ -385,8 +400,7 @@ def apply(bond):
if bond['dhcp_vendor_class_id']:
opt['vendor_class_id'] = bond['dhcp_vendor_class_id']
- # store DHCP config dictionary - used later on when addresses
- # are requested
+ # store DHCP config dictionary - used later on when addresses are aquired
b.set_dhcp_options(opt)
# ignore link state changes