Portal Home > Knowledgebase > VPN - Android > Android: OpenVPN on rooted firmware


Android: OpenVPN on rooted firmware




This HOW-TO is provided for those who enjoy hacking their Android phone. It's not simple and the instructions may not match your device or firmware exactly. On some firmwares it may not work at all. If Cyanogen is available for your phone, we recommend you use that instead.

Pre-requisites:

  • bundle.zip from https://12vpn.com/android/
  • tun.ko kernel driver suitable for your Android kernel. (We use this one: click here - on our Nexus One phone, but you will likely need a different one. The correct tun.ko can only be provided by the person/group who provided you your Android kernel.)

Step 1: Installing requires applications from Market

Although you won't need to use BusyBox yourself, OpenVPN will not function with out it. (In fact, OpenVPN will appear to connect, but not be usable as it cannot configure the Android network interfaces without BusyBox.)

Finally we need to install both OpenVPN Installer and OpenVPN Settings, both from Friedrich Schauffelhut.

BusyBox and OpenVPN aren't installed completely just by installing them from the Market. You need to run them both to complete their installation.

Important:

  • The BusyBox installer should say both Your phone is rooted as well as Currently installed BusyBox version is: 1.x.x. If you fail to install it, please consult the online community for your phone or firmware.
  • For our example here we installed it in /system/xbin/bb - which we recommend. (In fact, it did not work properly when installed elsewhere.)

Proceed with the OpenVPN Installer:

When running the OpenVPN installer, we recommend you install into /system/xbin as shown below:

Next it will ask you for the ifconfig/route path, which is where you installed BusyBox. In our case we refer to /system/xbin/bb .


Step 2: Installing external files

  1. Mount your phone through USB. This gives you access to /sdcard/
  2. Create a folder called openvpn on the sdcard. (So the resulting Android path will be /sdcard/openvpn/ - note that Android is case-sensitive. Do NOT use CAPS.)
  3. Place the contents of bundle.zip in the openvpn folder on the sdcard. (Unzip bundle.zip and drag all resulting files to the openvpn folder you created.)
  4. From https://12vpn.com/downloads/expert/ also download one or more "default" configs and place them in the same openvpn folder on the sdcard.
  5. Copy the tun.ko to the phone as well. Place it in the root of the sdcard (so the Android name will be /sdcard/tun.ko).
  6. Unmount or eject the Android phone.
  7. Disable USB mode on the Android phone. (If USB mode is not properly disabled, the next instructions will FAIL because Android cannot access the sdcard while USB mode is on.)

Step 3: Configuring TUN driver

Without a properly configured TUN driver, OpenVPN will connect to the VPN but you will not be able to actually use. The exact way to configure tun.ko will vary depending on your phone.

Step 4: Enabling OpenVPN

Now start OpenVPN Settings and enable OpenVPN.

That's it! You should now be able to connect to the VPN! If you don't see the different server options (San Jose, Fremont, etc.) you may have to tap Refresh first.

 

Common problems

 

  • I don't see the server choices, even when I tap Refresh. Make sure the USB host mode has been disabled. Android cannot access the SDCARD when USB host mode is enabled.
  • Options Error: Unrecognized option or mising parameter(s) in [PUSH-OPTIONS]:1: ifconfig (2.1.1). This means that BusyBox was not installed or that it is installed in the wrong location. During our tests it was not enough to just install BusyBox anywhere and match the location in OpenVPN installer. It only worked when installed in /system/xbin/bb.
  • link_image[1995]: failed to link /system/bin/openvpn 
  • CANNOT LINK EXECUTABLE. Be sure to install openvpn in /system/xbin, not in /system/bin.
  • cannot allocate tun/tap dev dynamically. Check that the path to tun.ko is correct. Check that tun.ko is the correct version for your kernel. (The one posted above is for a very specific Nexus One kernel. You'll probably need a different one.) Try loading the module manually by executing insmod /sdcard/tun.ko in a Terminal, this should give you a more descriptive error.


Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
Cyanogen 7 on Nexus S (Views: 795)