Page 1 of 1

Suggestion: include another config (part) in conf-file

Posted: Wed Mar 12, 2014 2:25 am
by altuhovd
Other popular software, most notably apache, have long had the capability of breaking their large or complex configurations into smaller more manageable files which are included into the main configuration.

Like SQUID: "include /etc/squid/peers.conf"
http://wiki.squid-cache.org/Features/ConfigIncludes

is it possible to add this feature in the OpenVPN?

Re: Suggestion: include another config (part) in conf-file

Posted: Wed Mar 12, 2014 11:49 am
by maikcat
most common openvpn configs are usually about 20 lines....

i dont think that it would any good to break config file...

as you correctly pointed out
their large or complex configurations
do you think 20 lines of config is large or complex? :shock:

just my 2 cents.

Michael.

Re: Suggestion: include another config (part) in conf-file

Posted: Wed Mar 12, 2014 6:42 pm
by altuhovd
it's useful in this case:
main config file server.conf conatins:

Code: Select all

***openvpn config lines***
include ipbind.include
ipbind.include file contains:

Code: Select all

local 1.2.3.4
i can simply change the contents only in file ipbind.include and restart openvpn.
Without include i need two exacly config-files with different "local" line

Re: Suggestion: include another config (part) in conf-file

Posted: Tue Jan 27, 2015 5:09 am
by pjincz
I need this function too.

I have a very long route list.
About 3600 lines.
I don't want put them in main config file.

Re: Suggestion: include another config (part) in conf-file

Posted: Thu Oct 15, 2015 8:06 am
by k0ste
Guys, I found workaround

main.conf:

Code: Select all

client-config-dir /etc/openvpn/routes
From manual:
OpenVPN will try to open and parse a default file called "DEFAULT", which may be provided but is not required.
/etc/openvpn/routes/DEFAULT:

Code: Select all

push "route 1.2.3.1 255.255.255.255"
push "route 1.1.2.3 255.255.255.255"
push "route 2.3.44.22 255.255.255.255"
It's works for me.

Important notice: file can be managed and apply without restart OpenVPN, and it's perfect.

Re: Suggestion: include another config (part) in conf-file

Posted: Tue Apr 05, 2016 7:57 pm
by l4h
Notice that you can use --config multiple times, to merge several configuration files. Or you can use 'config' inside a configuration file to "include" another configuration file.
https://community.openvpn.net/openvpn/w ... edwithOVPN