summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-06-26 16:56:12 +0200
committerDaniil Baturin <daniil@vyos.io>2021-08-12 09:17:56 -0500
commite4e3840ad5ede376e52b18e0aff777c25176a2e8 (patch)
treee310318c24042e43216a0650054574dc8cf8ed65
parent94ef913e630426ff255a2090f1f697a937d51b42 (diff)
downloadvyos-1x-e4e3840ad5ede376e52b18e0aff777c25176a2e8.tar.gz
vyos-1x-e4e3840ad5ede376e52b18e0aff777c25176a2e8.zip
nat: T1083: fix Jinja2 templating error
Commit 166d44b3 ("nat: T1083: add translation options for persistent/random mapping of address and port") added support for persistent IP address and port mappings for NAT. Unfortunately one if clause got lost in translation.
-rw-r--r--data/templates/firewall/nftables-nat.tmpl4
1 files changed, 2 insertions, 2 deletions
diff --git a/data/templates/firewall/nftables-nat.tmpl b/data/templates/firewall/nftables-nat.tmpl
index e2776e9c2..40ed1b916 100644
--- a/data/templates/firewall/nftables-nat.tmpl
+++ b/data/templates/firewall/nftables-nat.tmpl
@@ -73,8 +73,8 @@
{% set trns_addr = 'return' %}
{% set trns_port = '' %}
{% endif %}
-{# T1083: NAT address and port translation options #}
-{% if config.translation.options is defined and config.translation.options is not none %}
+{# T1083: NAT address and port translation options #}
+{% if config.translation is defined and config.translation.options is defined and config.translation.options is not none %}
{% if config.translation.options.address_mapping is defined and config.translation.options.address_mapping == "persistent" %}
{% set trns_opts_addr = 'persistent' %}
{% endif %}