summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2026-06-02 14:42:26 +0100
committerGitHub <noreply@github.com>2026-06-02 14:42:26 +0100
commite238afbd6bc272b02b426f1b16fe8d16f6069c05 (patch)
tree187e47c095186bcb27873851df99dfe5497b530d /python
parent09240f799565f12a13de6f718e36fa6165d9e865 (diff)
parent960e730bdde2f3561aa3cff8941e2f9db8eb32d8 (diff)
downloadvyos-1x-e238afbd6bc272b02b426f1b16fe8d16f6069c05.tar.gz
vyos-1x-e238afbd6bc272b02b426f1b16fe8d16f6069c05.zip
Merge pull request #5236 from c-po/nat66
nat: T8939: fix KeyError: 'group' exception
Diffstat (limited to 'python')
-rw-r--r--python/vyos/nat.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/python/vyos/nat.py b/python/vyos/nat.py
index 7be957a0c..0a252bbd8 100644
--- a/python/vyos/nat.py
+++ b/python/vyos/nat.py
@@ -37,7 +37,7 @@ def parse_nat_rule(rule_conf, rule_id, nat_type, ipv6=False):
operator = '!='
iiface = iiface[1:]
output.append(f'iifname {operator} {{{iiface}}}')
- else:
+ elif 'group' in rule_conf['inbound_interface']:
iiface = rule_conf['inbound_interface']['group']
if iiface[0] == '!':
operator = '!='
@@ -52,7 +52,7 @@ def parse_nat_rule(rule_conf, rule_id, nat_type, ipv6=False):
operator = '!='
oiface = oiface[1:]
output.append(f'oifname {operator} {{{oiface}}}')
- else:
+ elif 'group' in rule_conf['outbound_interface']:
oiface = rule_conf['outbound_interface']['group']
if oiface[0] == '!':
operator = '!='
@@ -80,7 +80,6 @@ def parse_nat_rule(rule_conf, rule_id, nat_type, ipv6=False):
if redirect_port:
translation_output.append(f'to {redirect_port}')
else:
-
translation_prefix = nat_type[:1]
translation_output = [f'{translation_prefix}nat']