summaryrefslogtreecommitdiff
path: root/data/templates
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-01-17 18:39:21 +0100
committerChristian Poessinger <christian@poessinger.com>2021-01-17 18:41:14 +0100
commit4c288cf08078bf7806dd34f103819e686bd11ad7 (patch)
tree993075c6972e2efe2bbae117c0381e4ba7c7de9b /data/templates
parent93498a83b370f24ab38d9ae160fd3e5a5b7fc54a (diff)
downloadvyos-1x-4c288cf08078bf7806dd34f103819e686bd11ad7.tar.gz
vyos-1x-4c288cf08078bf7806dd34f103819e686bd11ad7.zip
openvpn: T2381: bugfix rendering multiple openvpn-options from CLI
The CLI statement "set interfaces openvpn vtun10 openvpn-option '--tun-mtu 1500 --fragment 1300 --mssfix'" will render in vtun10.conf to: --tun-mtu 1500 --fragment 1300 --mssfix On startup OpenVPN complains about: openvpn-vtun10: Options error: Unrecognized option or missing or extra parameter(s) in vtun10.conf:76: tun-mtu (2.4.7) The options must be split on -- to a new configuration line. (cherry picked from commit f8a8ee02d0ede240f555ffa558665df686df24a8)
Diffstat (limited to 'data/templates')
-rw-r--r--data/templates/openvpn/server.conf.tmpl6
1 files changed, 5 insertions, 1 deletions
diff --git a/data/templates/openvpn/server.conf.tmpl b/data/templates/openvpn/server.conf.tmpl
index b3b0c936a..79288e40f 100644
--- a/data/templates/openvpn/server.conf.tmpl
+++ b/data/templates/openvpn/server.conf.tmpl
@@ -281,6 +281,10 @@ compat-names
# Custom options added by user (not validated)
#
{% for option in openvpn_option %}
-{{ option }}
+{% for argument in option.split('--') %}
+{% if argument is defined and argument != '' %}
+--{{ argument }}
+{% endif %}
+{% endfor %}
{% endfor %}
{% endif %}