summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorNicolas Fort <nicolasfort1988@gmail.com>2022-04-08 14:55:01 +0000
committerNicolas Fort <nicolasfort1988@gmail.com>2022-04-08 14:55:01 +0000
commit3a5cf74b06cef960e9a701172618c2c366591255 (patch)
tree45bfa3566313dd7ba0f0ae4fda81b8247507d4b1 /python
parent654dbc9aa3b0d27ec4f3faefff6cbd85fc3e1d1a (diff)
downloadvyos-1x-3a5cf74b06cef960e9a701172618c2c366591255.tar.gz
vyos-1x-3a5cf74b06cef960e9a701172618c2c366591255.zip
Firewall: T990: Add snat and dnat connection status on firewall
Diffstat (limited to 'python')
-rw-r--r--python/vyos/firewall.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/python/vyos/firewall.py b/python/vyos/firewall.py
index ff8623592..5e11e4332 100644
--- a/python/vyos/firewall.py
+++ b/python/vyos/firewall.py
@@ -49,6 +49,12 @@ def parse_rule(rule_conf, fw_name, rule_id, ip_name):
if states:
output.append(f'ct state {{{states}}}')
+ if 'ct_status' in rule_conf and rule_conf['ct_status']:
+ status = ",".join([s for s, v in rule_conf['ct_status'].items() if v == 'enable'])
+
+ if status:
+ output.append(f'ct status {{{status}}}')
+
if 'protocol' in rule_conf and rule_conf['protocol'] != 'all':
proto = rule_conf['protocol']
operator = ''