summaryrefslogtreecommitdiff
path: root/python/vyos/nat.py
diff options
context:
space:
mode:
authorNicolas Fort <nicolasfort1988@gmail.com>2023-03-14 18:07:39 +0000
committerNicolas Fort <nicolasfort1988@gmail.com>2023-03-14 18:24:02 +0000
commit80bdd7f93430769ea5cda32d1925dfcd43df5107 (patch)
tree195655cf7176f3fc512094564afdbcd7851ed06e /python/vyos/nat.py
parent16c494c2f1364283988b52e35faf6b01745bbed4 (diff)
downloadvyos-1x-80bdd7f93430769ea5cda32d1925dfcd43df5107.tar.gz
vyos-1x-80bdd7f93430769ea5cda32d1925dfcd43df5107.zip
T5055: NAT: extend packet-type match option which was previously introduced in firewall, to NAT
Diffstat (limited to 'python/vyos/nat.py')
-rw-r--r--python/vyos/nat.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/python/vyos/nat.py b/python/vyos/nat.py
index 8a311045a..53fd7fb33 100644
--- a/python/vyos/nat.py
+++ b/python/vyos/nat.py
@@ -47,6 +47,9 @@ def parse_nat_rule(rule_conf, rule_id, nat_type, ipv6=False):
protocol = '{ tcp, udp }'
output.append(f'meta l4proto {protocol}')
+ if 'packet_type' in rule_conf:
+ output.append(f'pkttype ' + rule_conf['packet_type'])
+
if 'exclude' in rule_conf:
translation_str = 'return'
log_suffix = '-EXCL'