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

This is where we can discuss what we would like to see added or changed in OpenVPN.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Post Reply
altuhovd
OpenVpn Newbie
Posts: 2
Joined: Wed Mar 12, 2014 2:19 am

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

Post by altuhovd » Wed Mar 12, 2014 2:25 am

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?

User avatar
maikcat
Forum Team
Posts: 4200
Joined: Wed Jan 12, 2011 9:23 am
Location: Athens,Greece
Contact:

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

Post by maikcat » Wed Mar 12, 2014 11:49 am

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.
Amiga 500 , Zx +2 owner
Long live Dino Dini (Kick off 2 Creator)

Inflammable means flammable? (Dr Nick Riviera,Simsons Season13)

"objects in mirror are losing"

altuhovd
OpenVpn Newbie
Posts: 2
Joined: Wed Mar 12, 2014 2:19 am

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

Post by altuhovd » Wed Mar 12, 2014 6:42 pm

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

pjincz
OpenVpn Newbie
Posts: 1
Joined: Tue Jan 27, 2015 5:07 am

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

Post by pjincz » Tue Jan 27, 2015 5:09 am

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.

k0ste
OpenVpn Newbie
Posts: 1
Joined: Thu Oct 15, 2015 8:01 am
Location: Russia
Contact:

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

Post by k0ste » Thu Oct 15, 2015 8:06 am

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.

l4h
OpenVpn Newbie
Posts: 7
Joined: Thu Feb 12, 2015 12:25 pm

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

Post by l4h » Tue Apr 05, 2016 7:57 pm

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

Post Reply