Openvpn client not connecting in raspberry pi

Scripts to manage certificates or generate config files

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

Post Reply
serenityrox
OpenVpn Newbie
Posts: 2
Joined: Sun Apr 21, 2013 4:11 pm

Openvpn client not connecting in raspberry pi

Post by serenityrox » Sun Apr 21, 2013 4:56 pm

I am having a problem with getting my raspberry pi to connect to my openvpn server. I have done that apt-get install openvpn, and then I created a directory to place my .ovpn files. I then run the script by doing sudo openvpn auto.ovpn. I have tried this with both locked, and auto login files. Neither are working. Please help!!!! Going crazy, and I am sure that it is something trivial. Thanks Any help would be greatly appreciated.

mwandelaar
OpenVPN Super User
Posts: 219
Joined: Mon Nov 23, 2009 8:24 pm

Re: Openvpn client not connecting in raspberry pi

Post by mwandelaar » Mon Apr 22, 2013 5:07 am

When installing openvpn on linux (assuming you are running the default Raspbian on your PI) you need to place the configfiles:
* in /etc/openvpn AND
* the extension needs to be .conf and not .ovpn
to be able to start automatically.

And, ofcourse, the path's to the key + certfiles needs te be full path's.
Hope this helps.

joubink
OpenVpn Newbie
Posts: 2
Joined: Tue May 21, 2013 5:08 pm

Re: Openvpn client not connecting in raspberry pi

Post by joubink » Tue May 21, 2013 5:14 pm

Hi mwandelaar,
After changing the extension and placing in the directory, what else do we need to do for it to start automatically? Also what do you mean by full paths?
Your help is much appreciated.
Thanks

mwandelaar
OpenVPN Super User
Posts: 219
Joined: Mon Nov 23, 2009 8:24 pm

Re: Openvpn client not connecting in raspberry pi

Post by mwandelaar » Tue May 28, 2013 7:43 am

Openvpn can start automatically at boot-time. To do this, openvpn expects one or more files in /etc/openvpn, where the name end in .conf

If they are there, the startup-script wil pass these configfiles to openvpn and openvpn starts using this configfile.
Reading in this configfile, openvpn needs to know where to find the private, certificate and ca-certificate. They will be somewhere on disk (sd-card in case of a Raspberry PI) so openvpn needs to know exactly where to find these files.
Therefore the configfiles needs to point to these files with there full path:

Code: Select all

ca /etc/openvpn/certs/cacert.pem
key /etc/openvpn/vcerts/private.key
cert /etc/openvpn/certs/cert.pem
Also make sure openvpn is started automatically, as root check:

Code: Select all

update-rc.d openvpn defaults
Please let me know.

joubink
OpenVpn Newbie
Posts: 2
Joined: Tue May 21, 2013 5:08 pm

Re: Openvpn client not connecting in raspberry pi

Post by joubink » Mon Jun 03, 2013 1:11 am

Thanks so much. My config file already contains the private and the certificate parts. They are not in separate files. So it should work as is. If it doesn't I'll pass that on.
Thanks.

mwandelaar
OpenVPN Super User
Posts: 219
Joined: Mon Nov 23, 2009 8:24 pm

Re: Openvpn client not connecting in raspberry pi

Post by mwandelaar » Sat Jun 08, 2013 11:53 am

When you manually start openvpn, does it work? Please try:

Code: Select all

sudo openvpn --verb 3 --config your-config-file.conf
And if not, can you post the logging here?
If that's not working, making openvpn autostart doesn't help either.

Post Reply