diff options
author | Nicolas Vollmar <nvo@scaling.ch> | 2024-08-27 12:55:35 +0200 |
---|---|---|
committer | Nicolas Vollmar <nvo@scaling.ch> | 2024-09-02 13:41:15 +0200 |
commit | f96733dd1e8d840012d98740006d7999a9fa6776 (patch) | |
tree | 1763953ed7b56620d0223093a4c4a24d9ff28417 /python | |
parent | c78c5bd7e65b19e0e50ef6944dc74fb33660ff71 (diff) | |
download | vyos-1x-f96733dd1e8d840012d98740006d7999a9fa6776.tar.gz vyos-1x-f96733dd1e8d840012d98740006d7999a9fa6776.zip |
T6679: add destination groups
Diffstat (limited to 'python')
-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 = '' |