OSX, Ubuntu and OpenVPN in 5 Minutes.
Today I’m quickly going to cover the very basic steps you can follow to get a simple OpenVPN tunnelling setup working using an Ubuntu Server / VPS (I’m using a Linode VPS running Ubuntu 9.04) with near-transparent support for OpenVPN on OSX.
Step 1. Getting OpenVPN
I attempted over a year ago to get OpenVPN running with James Golick’s fantastic tutorial “How to Watch Hulu From Canada (or Anywhere Else)”. Unfortunately, the process was always kind of sketchy and required a bunch of manual tweaking from my end to get it working flawlessly.
Recently though, I discovered OpenVPN’s Access Server package – Essentially, a super simple way to install, configure and use OpenVPN. Even better, OpenVPN AS is free for up to two concurrent connections so for most users you wont have to pay a cent. Since I’m on Ubuntu 9.04 (Built as a 64 bit install), getting it installed was a simple matter of:
curl -O http://swupdate.openvpn.net/as/openvpn-as-1.5.6-Ubuntu9.amd_64.deb
sudo dpkg -i openvpn-as-1.5.6-Ubuntu9.amd_64.deb
sudo /usr/local/openvpn_as/bin/ovpn-init
And following the configuration options. Doing so will go through a very quick and simple wizard that lets you set up OpenVPN Access Server.
The only change I made from the default config was to use a user other than root as my administrative user.
With that done, it’s a matter of simply visiting:
https://your-servers-ip:943/
And signing in with the Unix Username / Password of the user you chose during the install. If you get a certificate not trusted warning, you should be able to ignore it (since it was one generated on your server) for the moment.
With that done, you should see a page similar to:
Download the file from the client.ovpn link and save it somewhere safe on your computer.
Step 2: Hooking it up to OSX
Now, the second step and the most important, is to actually get it going with OSX. In this case, I choice to use Viscosity (for sheer simplicity / prettiness of it) which costs $9USD as of writing. If you’d prefer to use a free client, TunnelBlick should work similarly.
Setting it up within Viscosity was a simple matter of clicking the “+” option in the Connections
pane of Viscosity’s preferences, Selecting “Import Connection”, “From File…” and choosing the
client.ovpn file we downloaded earlier.
With that said and done, I chose to set Viscosity to start at login, moved the menu bar to the right of the clock and then closed the preferences. Will all that said and done, connecting to my VPN was then a simple matter of clicking the Viscosity icon and asking it to connect to the connection I configured.
Conclusion
All in all, it took about 5 minutes (from start to finish, given I had a server set up already) to go from using my local internet connection to having a simple to use VPN that tunnelled my Internet via the US.