diff options
author | Christian Breunig <christian@breunig.cc> | 2024-09-11 07:48:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-11 07:48:49 +0200 |
commit | 4bbd5c7c13f7ea72ba40813db0e6258ecf0a59f7 (patch) | |
tree | 6f4de57bc5af3b482619a91ff1dfcf144214b4a8 /python/vyos/nat.py | |
parent | 7767fb40b4c4e48a73cbff88860b889302476d22 (diff) | |
parent | f96733dd1e8d840012d98740006d7999a9fa6776 (diff) | |
download | vyos-1x-4bbd5c7c13f7ea72ba40813db0e6258ecf0a59f7.tar.gz vyos-1x-4bbd5c7c13f7ea72ba40813db0e6258ecf0a59f7.zip |
Merge pull request #4023 from nvollmar/T6679
T6679: add group option for nat66
Diffstat (limited to 'python/vyos/nat.py')
-rw-r--r-- | python/vyos/nat.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/python/vyos/nat.py b/python/vyos/nat.py index e54548788..5fab3c2a1 100644 --- a/python/vyos/nat.py +++ b/python/vyos/nat.py @@ -199,7 +199,10 @@ def parse_nat_rule(rule_conf, rule_id, nat_type, ipv6=False): if group_name[0] == '!': operator = '!=' group_name = group_name[1:] - output.append(f'{ip_prefix} {prefix}addr {operator} @A_{group_name}') + if ipv6: + output.append(f'{ip_prefix} {prefix}addr {operator} @A6_{group_name}') + else: + output.append(f'{ip_prefix} {prefix}addr {operator} @A_{group_name}') # Generate firewall group domain-group elif 'domain_group' in group and not (ignore_type_addr and target == nat_type): group_name = group['domain_group'] @@ -214,7 +217,10 @@ def parse_nat_rule(rule_conf, rule_id, nat_type, ipv6=False): if group_name[0] == '!': operator = '!=' group_name = group_name[1:] - output.append(f'{ip_prefix} {prefix}addr {operator} @N_{group_name}') + if ipv6: + output.append(f'{ip_prefix} {prefix}addr {operator} @N6_{group_name}') + else: + output.append(f'{ip_prefix} {prefix}addr {operator} @N_{group_name}') if 'mac_group' in group: group_name = group['mac_group'] operator = '' |