diff options
author | Christian Poessinger <christian@poessinger.com> | 2019-10-13 12:31:40 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2019-10-13 12:31:40 +0200 |
commit | 177de5378a1e9e6983e34ef4a5244310b78d870a (patch) | |
tree | 01690020455a418462ead14eeb11600bb51b4ede /src | |
parent | cdfe017ea6bfc7d4306d9e73c44f40671f41fdbc (diff) | |
download | vyos-1x-177de5378a1e9e6983e34ef4a5244310b78d870a.tar.gz vyos-1x-177de5378a1e9e6983e34ef4a5244310b78d870a.zip |
bonding: T1614: support DHCP options on VLAN interfaces
Diffstat (limited to 'src')
-rwxr-xr-x | src/conf_mode/interface-bonding.py | 18 |
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 |