From 43554efc27fcea6703b3b31674a38252434a0f2f Mon Sep 17 00:00:00 2001 From: Ryan Zuwala Date: Tue, 29 Apr 2025 00:53:53 -0400 Subject: nat66: T7051: add group config node Add CLI config node for "group" when configuring NAT66 source Ensure there is only one group in NAT66 source rule config Add smoketest to cover new group usage in source NAT66 rules --- src/conf_mode/nat66.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/conf_mode/nat66.py b/src/conf_mode/nat66.py index 95dfae3a5..c65950c9e 100755 --- a/src/conf_mode/nat66.py +++ b/src/conf_mode/nat66.py @@ -92,6 +92,10 @@ def verify(nat): if prefix != None: if not is_ipv6(prefix): raise ConfigError(f'{err_msg} source-prefix not specified') + + if 'destination' in config and 'group' in config['destination']: + if len({'address_group', 'network_group', 'domain_group'} & set(config['destination']['group'])) > 1: + raise ConfigError('Only one address-group, network-group or domain-group can be specified') if dict_search('destination.rule', nat): for rule, config in dict_search('destination.rule', nat).items(): -- cgit v1.2.3