In T3350#90321, @Viacheslav wrote:Another solution it include "user" defined file for options
An example CLIset interfaces openvpn vtun10 openvpn-option-include '/config/openvpn/included.conf'diff --git a/data/templates/openvpn/server.conf.tmpl b/data/templates/openvpn/server.conf.tmpl index 79288e40..bcc88c09 100644 --- a/data/templates/openvpn/server.conf.tmpl +++ b/data/templates/openvpn/server.conf.tmpl @@ -288,3 +288,8 @@ compat-names {% endfor %} {% endfor %} {% endif %} + +# Include file for configuration options +{% if openvpn_option_include is defined and openvpn_option_include is not none %} +config {{ openvpn_option_include }} +{% endif %} diff --git a/interface-definitions/interfaces-openvpn.xml.in b/interface-definitions/interfaces-openvpn.xml.in index effbdd67..2cba59af 100644 --- a/interface-definitions/interfaces-openvpn.xml.in +++ b/interface-definitions/interfaces-openvpn.xml.in @@ -314,6 +314,14 @@ <multi/> </properties> </leafNode> + <leafNode name="openvpn-option-include"> + <properties> + <help>Additional OpenVPN file configuration. You must + use the syntax of openvpn.conf in this file. Using this + without proper knowledge may result in a crashed OpenVPN server. + Check system log to look for errors.</help> + </properties> + </leafNode> <leafNode name="persistent-tunnel">
- Queries
- All Stories
- Search
- Advanced Search
- Transactions
- Transaction Logs
Feed Advanced Search
Advanced Search
Advanced Search
Mar 23 2021
Mar 23 2021
Mar 17 2021
Mar 17 2021
I am not sure why these extra options are parsed to begin with. My view is Vyos gives the possibility to write extra config file elements because it is not yet supported by the Vyos system configuration. Therefore it should be up to the user to write the correct data as it was in the past.
There should be absolutely no parsing whatsoever and options must be passed through the file unchanged.
Feb 24 2021
Feb 24 2021