Solved Running openvpn twice?

nielsk

Member

Reaction score: 5
Messages: 22

I have two openvpn-server. Now I want to have one of my clients connect to both and do that on startup.
For connecting to one server I just add openvpn_enable and openvpn_flags to my rc.conf and I am ready to go.

But what do I do to start openvpn twice on startup with two different configurations?
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,371
Messages: 29,907

Read the rc(8) script. You can set profiles and use different options for each profile.

At the moment I don't have access to a server with OpenVPN installed but from the top of my head it was something like this:
Code:
openvpn_profiles="set1 set2"
openvpn_set1_options="foo"
openvpn_set1_enable="YES"
openvpn_set2_options="bar"
openvpn_set2_enable="YES"
 
OP
OP
nielsk

nielsk

Member

Reaction score: 5
Messages: 22

Thanks. I skimmed it but after your hint I read it more thoroughly. You have to create links to the script and then you can run additional instances.

Code:
# This script supports running multiple instances of openvpn.
# To run additional instances link this script to something like
# % ln -s openvpn openvpn_foo 36 # and define additional openvpn_foo_* variables in one of
# /etc/rc.conf, /etc/rc.conf.local or /etc/rc.conf.d/openvpn_foo
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,371
Messages: 29,907

Ah, yes. Some ports use the 'profile' option, some ports do it like that. Unfortunately there's no real standard regarding this. But reading the port's rc(8) script usually provides enough clues to get it working.
 
Top