I have finally gotten OpenVPN working on my Motorola Droid. Here are a few short notes for anyone who is on a similar mission.
- This method requires root access for which I used CyanogenMod 6.0. If your phone is not already rooted you will need to do this first (CyanogenMod or another ROM).
- Since the TUN module was removed I had to switch to a different kernel. I choose the P3Droid 1250 2.2 low voltage (125Mhz) kernel using setCPU to manage my clock speeds. This kernel is important because it adds TUN support. I had no end of trouble trying to load the module myself with
insmodwhich never ended up working any way.
- Create some directories and symbolic links. To do this I ran
adb remount; adb shell mkdir /system/xbin/bb; adb shell ln -s /system/xbin/ifconfig /system/xbin/bb/ifconfig; adb shell ln -s /system/xbin/route /system/xbin/bb/routefrom my host PC with the USB cable plugged into my Droid using the Android SDK. Note that I run Linux but if you are running Windows just run each command in between the semi-colons, one by one.
- I ran OpenVPN Installer available in the Android Market. When asked make sure you answer
- Now you are ready to load up your OpenVPN-related stuff. Write a new configuration (named whatever.conf) and generate some new certificates for your new client. Stick them on your SD card in the
- Install OpenVPN Settings from the Android Market. Once opened it should now show the configuration file you stuck on your SD card. Just tap it and watch it connect.
You may want to tweak your configuration a bit to ping more often or the like to deal with the fact this is a cellular connection and it will be going up and down on a regular basis. Both TAP and TUN adapters worked great in my tests.
If any of this seems confusing or you do not understand what a line does you should not be doing any of this. A lot of these commands– if done in the wrong context, at the wrong time, in the wrong order, or if your chi is off– will brick your phone and your warranty will be voided. Hell, your warranty will be voided if everything goes right. Beware!