diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-01-17 18:39:21 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-01-17 18:39:21 +0100 |
commit | f8a8ee02d0ede240f555ffa558665df686df24a8 (patch) | |
tree | 612e14c6cfdfd147b395cc7db15f4d900f34b7ed | |
parent | e0fdf9b4d746e751d0c12c1e6bd2d10daf22ec76 (diff) | |
download | vyos-1x-f8a8ee02d0ede240f555ffa558665df686df24a8.tar.gz vyos-1x-f8a8ee02d0ede240f555ffa558665df686df24a8.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.
-rw-r--r-- | data/templates/openvpn/server.conf.tmpl | 6 |
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 %} |