Raspberry Pi is quickly becoming a geek’s best friend, powering everything from robots to OpenVPN. This tutorial will help one in setting up our TorGuard OpenVPN (SSL) connection on the Raspbmc distribution.

Note: These instructions presume you are a legit geek and live for entering commands from a UNIX shell prompt.

If you aren’t sure about anything, just let us know and our support team will do their best to clarify. Let’s get started:

First, install raspbmc and ensure it is working correctly and has access to the internet.

From another computer you must first use ssh to connect to the raspbmc, on Windows machine you will need to use putty. Apple/OSX and Linux systems have ssh (terminal) built in, so just open a terminal and ssh in directly.

Login in as pi password is raspberry

You should then see the UNIX bash prompt:

pi@raspbmc:~$

You need to be super user to install OpenVPN so enter sudo bash followed by return.
The prompt should update to indicate you are logged in as root, it should now be:

root@raspbmc:/home/pi#

Note, you are now root or the super user, so proceed with caution.

Next, you need to update the software repositories. enter apt-get update and press return, depending on the speed of your connection it may take a few minutes or more to complete. Once this is complete, we need to install OpenVPN. To install, enter: apt-get install openvpn and press return, again this will take a minute of so, once finished you will be returned to the prompt.

Next, you need to get our TorGuard OpenVPN Rasberry Pi connection script.
To download the file enter: wget and then the URL of the connection script you wish to use:

http://www.torguard.net/downloads/TorGuard.RP.Canada.txt

press enter.

Once the file has downloaded, edit it and change the username and password to your TorGuard VPN username and password.

Once that is done, you need to edit the system startup script so that it automatically connects to the vpn. To do this, edit the /etc/rc.local file and enter the following line, right before the line that says exit 0:

bash /home/pi/raspbmc-connect.txt

so for example, last two lines the file should read:

bash /home/pi/raspbmc-connect.txt
exit 0

Check the file for any mistakes and then type shutdown -fr to reboot the device.

After the system restarts, it will wait about 60 seconds and then try and connect to the VPN.
On the Computer, ssh back into the raspbmc and type ifconfig to list the network interfaces. If everything has been setup correctly, you should see an interface called tun0 in addition to the standard eth0 and lo.

If you don’t see tun0, then something went wrong, in which case please send our support desk a copy of the following files:
/etc/rc.local
/home/pi/raspbmc-connect.txt

this information should help us target where the problem is..

Share this post