summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorNicolas Fort <nicolasfort1988@gmail.com>2022-04-23 12:05:57 +0000
committerNicolas Fort <nicolasfort1988@gmail.com>2022-04-23 12:05:57 +0000
commit15e55af88e6104608487c1138641fcff54594d89 (patch)
tree8ea6c87fd55f274a8fb43493675f273d2fcd3924 /python
parent19d38aa98cd656a2d4c558f6c99635b3d662b9cb (diff)
downloadvyos-1x-15e55af88e6104608487c1138641fcff54594d89.tar.gz
vyos-1x-15e55af88e6104608487c1138641fcff54594d89.zip
Firewall: T990: Modifications for new connection-status cli
Diffstat (limited to 'python')
-rw-r--r--python/vyos/firewall.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/python/vyos/firewall.py b/python/vyos/firewall.py
index 06731dd64..04fd44173 100644
--- a/python/vyos/firewall.py
+++ b/python/vyos/firewall.py
@@ -51,7 +51,12 @@ def parse_rule(rule_conf, fw_name, rule_id, ip_name):
if 'connection_status' in rule_conf and rule_conf['connection_status']:
status = rule_conf['connection_status']
- output.append(f'ct status {{{status}}}')
+ if status['nat'] == 'destination':
+ nat_status = '{dnat}'
+ output.append(f'ct status {nat_status}')
+ if status['nat'] == 'source':
+ nat_status = '{snat}'
+ output.append(f'ct status {nat_status}')
if 'protocol' in rule_conf and rule_conf['protocol'] != 'all':
proto = rule_conf['protocol']