diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-09-24 21:31:47 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-09-24 21:31:47 +0200 |
commit | 7f09beeac924b1bc9bf61f8153870bd4cb939b96 (patch) | |
tree | ff1550fc2fd387810ca67df756000f12b4211840 /python | |
parent | 44698fb03cf2017e56adbd161c66be585822b87a (diff) | |
download | vyos-1x-7f09beeac924b1bc9bf61f8153870bd4cb939b96.tar.gz vyos-1x-7f09beeac924b1bc9bf61f8153870bd4cb939b96.zip |
dhcpv6-pd: verify: T2923: interface is required where the prefix is assigned
When configuring DHCPv6-PD it is mandatory to also specify at least one
interface where the newly delegated prefix will be used. Without this setting
DHCPv6-PD makes no sense at all.
Diffstat (limited to 'python')
-rw-r--r-- | python/vyos/configverify.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/python/vyos/configverify.py b/python/vyos/configverify.py index bf4e26fa7..afa6c7f06 100644 --- a/python/vyos/configverify.py +++ b/python/vyos/configverify.py @@ -113,6 +113,11 @@ def verify_dhcpv6(config): # assigned IPv6 subnet from a delegated prefix for pd in vyos_dict_search('dhcpv6_options.pd', config): sla_ids = [] + + if not vyos_dict_search(f'dhcpv6_options.pd.{pd}.interface', config): + raise ConfigError('DHCPv6-PD requires an interface where to assign ' + 'the delegated prefix!') + for interface in vyos_dict_search(f'dhcpv6_options.pd.{pd}.interface', config): sla_id = vyos_dict_search( f'dhcpv6_options.pd.{pd}.interface.{interface}.sla_id', config) |