Tamas Pisch's picture



I installed Turnkey Openvpn V16.0 appliance. I set up server mode on the A site, and created client configuration with confconsole. I copied the xyz.ovpn file to the appliance on B site as /etc/opencpn/xyz.conf. On B site, I set up the appliance as client.

I set up autorun in /etc/default/openvpn:


After restart, I see error message in log:

 ...error opening configuration file /etc/openvpn/server.conf

Ok, I don't have /etc/openvpn/server.conf on the client site. Do I need it? If yes, how I create/fill in it? If I don't need it, how can I avoid that error message?

openvpn --config /etc/openvpn/xyz.conf

works, at least I don't get the above error message.

Jeremy Davis's picture

FWIW the info about enabling the client OpenVPN service that you're following is the old way things were done back when sysvinit was the init system. TurnKey now uses systemd so that process is no longer relevant. Whilst the "openvpn" service still exists, it's actually a dummy service that will just create a server instance. OpenVPN now uses systemd templates to provide the relevant client service.

Most of the process reamins the same, just the actual commands to start the client service have changed. So in the case of your client, you've done exactly the right thing copying the xyz.ovpn file to the client appliance /etc/opencpn/xyz.conf. The bit you are missing, is to enable and start the new OpenVPN client service from the OpenVPN systemd template. The below will enable & start a new client service using the /etc/opencpn/xyz.conf file (change 'xyz' to be the real name of your conf file):

systemctl enable openvpn@xyz.service
systemctl start openvpn@xyz.service

If you wish to checkout what it's up to, you can check it's status like this:

systemctl status openvpn@xyz.service

Or for the full output, you can read the journal:

journalctl -u openvpn@xyz.service

I hope that helps.

PS I also noted that our docs are out of date and include the old sysvinit commands too, so I've updated them.

Tamas Pisch's picture

Thank you for your answer, it helped me.

Add new comment