Random Tech Thoughts

The title above is not random

Building Tunnelblick With Openvpn-ipv6 on Snow Leopard

Update: I will no longer compile Tunnelblick directly with openvpn-ipv6. Instead I will just compile openvpn-ipv6 and replace the openvpn executable shipped by Tunnelblick (located under Tunnelblick.app/Contents/Resources/openvpn/openvpn-<version>). This would be much easier to catch up with the new releases of Tunnelblick.

You can download my compiled 64bit openvpn binary for OS X on this github downloads page. I only use it on Lion, not sure if it works on Snow Leopard.

As my university’s network is in CERNET, we can only access foreign web site directly with ipv6. Because the stock Tunnelblick does not support ipv6, I’ve been using tunnelblick-ipv6 nearly everyday recently. The problem with Tunnelblick-ipv6 on google code is that it’s uploaded in Dec 2009 and can not run on 64bit OS X kernel, so I decided to compile an ipv6 enabled Tunnelblick by myself.

Tunnelblick is actually a GUI front end to openvpn. To enable ipv6 support we need an ipv6 enabled openvpn. Thanks to jjo, he has provided an ipv6 enabled openvpn on github. The Tunnelblick project only includes official openvpn releases due to security reasons and that’s why they do not include this version of openvpn. (Explained in this Google code issue.)

It’s not quite difficult to build Tunnelblick actually, but some problems arise during the process. I’ll briefly describe the process below. The final modified code is on github so you don’t need to do it again. I’ve also uploaded compiled binary for you if you trust me :) Here’s the link Tunnelblick-3.2beta25build2647.dmg

First get Tunnelblick’s source code, I’m using git to access subversion repository

git svn clone -s -r 1500:HEAD http://tunnelblick.googlecode.com/svn/ tunnelblick

Get openvpn-ipv6 from jjo’s repository

git clone https://github.com/jjo/openvpn-ipv6.git

Use openvpn-ipv6 to replace the openvpn in tunnelblick’s third party directory.

Then I removed the ppc build target for all the third party library and set the SDK to 10.6 since I’m not interested with other version of OS X and do not have 10.4 SDK installed. (I did this using Xcode and manually modified third part tools’ configuration file.)

Some problems arise when building openvpn-ipv6. It can not be configured with openssl-1.0.0d provided by Tunnelblick. I installed openvpn-0.9.8r with homebrew and modified the third part tools Makefile to use that instead. Another problem with openvpn-ipv6 is that IPV6_RECVPKTINFO is missing on OSX, after applying the one patch I can build Tunnelblick successfully use the following command

xcodebuild -configuration Release

Finally I cleaned up the modified code and put it on github. openvpn-ipv6 is added as a git submodule.

It’s also possible to replace the official Tunnelblick’s openvpn program with the one compiled from openvpn-ipv6 to make it support ipv6. So I’ve also uploaded the compiled binary to this github downloads page. Use it to replace the one in Tunnelblick.app/Contents/Resources.

Comments