HowTo: Setup RaspberryPi with OpenVPN Client

I recently set up a VPN Server on an EasyBox 904 xDSL. After that i wanted to connect my Raspberry Pi to it. Since it was not in my local network I registered an free Dyndns at selfhost.eu. Of course i had to enter this data in the EasyBox Updater.

I also downloaded the Certificate and the OpenVPN Credentials from the EasyBox. So the Files i had were:

johnsmith.ovpn
johnsmith.p12
vpns.crt
rootca.crt (not sure if necessary)

Ok, now I show you how I installed and configured OpenVPN Client on my Raspberry Pi. Just to be sure update+upgrade. In case you didn’t know. Update is for refreshing the package list. Upgrade checks if there are old packages installed on your system and updates them.

sudo apt-get update && sudo apt-get upgrade

Next command will install openvpn.

sudo apt-get install openvpn

Now you have to copy the files (.ovpn, .p12, crt) to /etc/openvpn/
I normally use Cyberduck (Mac) or WinSCP (Win) for copy files to my raspberry pi via ssh. So i drop them in /home/pi/ and move them with: sudo mv /home/pi/filename.end /etc/openvpn/

Now load the vpn profile:

sudo openvpn johnsmith.ovpn

Please check if ifconfig shows tap0 with IP. For me the IP for tap0 was missing. To solve this issue enter:

sudo dhclient tap0

Done.

If you would like to connect automatically on startup. Edit this file with your vpn profile:

nano /etc/default/openvpn

Sometime your client fails to load .ovpn ! Just rename it to .conf !

Advertisements

Posted on December 2, 2013, in Uncategorized. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: