summaryrefslogtreecommitdiff
path: root/python/vyos/template.py
diff options
context:
space:
mode:
authorsarthurdev <965089+sarthurdev@users.noreply.github.com>2022-09-21 02:05:30 +0200
committersarthurdev <965089+sarthurdev@users.noreply.github.com>2022-09-21 20:53:49 +0200
commitc6bbe051574acf5ca1501e631d73ac06bdb17b30 (patch)
tree3a10a0d4d58a2edb8b50e65d45f61b7574dd82af /python/vyos/template.py
parente6ba98a85ca72abc7e7e2001d208bcd1806c2c13 (diff)
downloadvyos-1x-c6bbe051574acf5ca1501e631d73ac06bdb17b30.tar.gz
vyos-1x-c6bbe051574acf5ca1501e631d73ac06bdb17b30.zip
nat: T4605: Refactor static NAT to use python module for parsing rules
* Rename table to vyos_nat * Add static NAT smoketest
Diffstat (limited to 'python/vyos/template.py')
-rw-r--r--python/vyos/template.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/python/vyos/template.py b/python/vyos/template.py
index d9ff98d2e..0870a0523 100644
--- a/python/vyos/template.py
+++ b/python/vyos/template.py
@@ -621,6 +621,11 @@ def nat_rule(rule_conf, rule_id, nat_type, ipv6=False):
from vyos.nat import parse_nat_rule
return parse_nat_rule(rule_conf, rule_id, nat_type, ipv6)
+@register_filter('nat_static_rule')
+def nat_static_rule(rule_conf, rule_id, nat_type):
+ from vyos.nat import parse_nat_static_rule
+ return parse_nat_static_rule(rule_conf, rule_id, nat_type)
+
@register_filter('range_to_regex')
def range_to_regex(num_range):
from vyos.range_regex import range_to_regex