From 7f09beeac924b1bc9bf61f8153870bd4cb939b96 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Thu, 24 Sep 2020 21:31:47 +0200 Subject: 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. --- python/vyos/configverify.py | 5 +++++ 1 file changed, 5 insertions(+) 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) -- cgit v1.2.3