summaryrefslogtreecommitdiff
path: root/data/templates
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-02-17 20:58:48 +0100
committerGitHub <noreply@github.com>2022-02-17 20:58:48 +0100
commit1e60e4a29688112256a30c188512e11a9df91af1 (patch)
tree66694e3855d3a30240b9f8a6f2e163b19f6da55e /data/templates
parentb14e91cb5547c8e3b9cc511aeb71d189f56cd55d (diff)
parent4552dbcf38b01596270c649c07b980f37b627fc2 (diff)
downloadvyos-1x-1e60e4a29688112256a30c188512e11a9df91af1.tar.gz
vyos-1x-1e60e4a29688112256a30c188512e11a9df91af1.zip
Merge pull request #1221 from sever-sever/T3686-equ
openvpn: T3686: Fix for check local-address in script and tmpl
Diffstat (limited to 'data/templates')
-rw-r--r--data/templates/openvpn/server.conf.tmpl10
1 files changed, 6 insertions, 4 deletions
diff --git a/data/templates/openvpn/server.conf.tmpl b/data/templates/openvpn/server.conf.tmpl
index c2b0c2ef9..75aae2981 100644
--- a/data/templates/openvpn/server.conf.tmpl
+++ b/data/templates/openvpn/server.conf.tmpl
@@ -135,11 +135,13 @@ ping {{ keep_alive.interval }}
ping-restart {{ keep_alive.failure_count }}
{% if device_type == 'tap' %}
-{% for laddr, laddr_conf in local_address.items() if laddr | is_ipv4 %}
-{% if laddr_conf is defined and laddr_conf.subnet_mask is defined and laddr_conf.subnet_mask is not none %}
+{% if local_address is defined and local_address is not none %}
+{% for laddr, laddr_conf in local_address.items() if laddr | is_ipv4 %}
+{% if laddr_conf is defined and laddr_conf.subnet_mask is defined and laddr_conf.subnet_mask is not none %}
ifconfig {{ laddr }} {{ laddr_conf.subnet_mask }}
-{% endif %}
-{% endfor %}
+{% endif %}
+{% endfor %}
+{% endif %}
{% else %}
{% for laddr in local_address if laddr | is_ipv4 %}
{% for raddr in remote_address if raddr | is_ipv4 %}