OpenVPN on the droid

Discussion in 'Android Hacks and Help' started by hanlong, Dec 22, 2009.

  1. hanlong

    hanlong New Member

    Joined:
    Dec 22, 2009
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Ratings:
    +0
    Anyone got OpenVPN working correctly on the droid? I tried using tunneldroid, installed the OpenVPN binaries, but am missing the tun.ko driver.

    I know if I drop in the tun drivers from a pre-existing cyanogen mod kernel for another phone it probably won't work because the kernel versions are different right? Anyone have any luck with this?
     
  2. hanlong

    hanlong New Member

    Joined:
    Dec 22, 2009
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Ratings:
    +0
  3. prochobo

    prochobo New Member

    Joined:
    Dec 19, 2009
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Ratings:
    +0
  4. spkane

    spkane New Member

    Joined:
    Jan 2, 2010
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Ratings:
    +0
    OpenVPN for Moto Droid

    Thank you both for this post. I have actually been looking for this info (sepcifically the Droid tun driver) since the day the Droid root was posted. Very useful. I'll be testing it all today.

    Thanks,
    Sean
     
  5. trevorj

    trevorj New Member

    Joined:
    Nov 11, 2009
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Ratings:
    +0
    OpenVPN is easy to get going on your droid. I made a script to do it, among other things. You'll need a custom kernel with CONFIG_TUN=Y/M. If M, you'll need the tun.ko in /system/lib/modules/. It works great with tunneldroid.

    http://skywww.net/~trevorj/droid/scripts/readme.txt

    This only runs on Linux. If you're on Windows, good luck.

    Oh, and you can use the boot image from sholes.info, or you can use mine. It's all up to you.
     
    Last edited: Jan 2, 2010
  6. hughesjr

    hughesjr Member

    Joined:
    Dec 11, 2009
    Messages:
    277
    Likes Received:
    0
    Trophy Points:
    16
    Ratings:
    +0
    Is there an equivalent to modules.conf (or modprobe.conf) for automatically loading kernel modules for android where we can make tun.ko autoload?

    I can load it manually now and everything works (thanks guys :D)
     
  7. mudtoe

    mudtoe New Member

    Joined:
    Dec 21, 2009
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Ratings:
    +0
    Are any of you having problems getting ifconfig to work from within OpenVPN? I've got it working, but I have to manually create the tun/tap device and then manually configure it with ifconfig before running OpenVPN, otherwise the tun/tap device ends up with an IP address that has the correct subnet address, but 255s for the rest of it. I also found that I have to manually load the tun driver each time the phone is rebooted.

    mudtoe
     
  8. hughesjr

    hughesjr Member

    Joined:
    Dec 11, 2009
    Messages:
    277
    Likes Received:
    0
    Trophy Points:
    16
    Ratings:
    +0
    I am using tunneldroid, it points to the path for tun.ko. It seems to work fine, everything happens via the GUI.
     
  9. prochobo

    prochobo New Member

    Joined:
    Dec 19, 2009
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Ratings:
    +0
    Use a program called "Autostart" in the market place and edit its configuration file to include the "insmod /system/lib/modules/tun.ko" command.
     
  10. Nox

    Nox New Member

    Joined:
    Jan 27, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Ratings:
    +0
    I did indeed have problems running ifconfig. According to what I've read, the issue revolves around whether or not you have a tun or tap vpn. I haven't tried tun so I'm not sure if I would have had the same problem with it but, just so it's clear, I am using tap.

    I got ifconfig to work with a simple script and some config changes to OpenVPN's configuration. It's important to note that there are a couple of things I could not do with Android's implementation of sh, namely:


    • Shebang. #!/system/bin/sh would not work, I had to leave it out.
    • Named variables. DEVICE=$1 followed by using $DEVICE elsewhere would not work. The device variable would be blank and would end up doing very weird things to the string I tried to use it on.
    • Android does not have a "test" binary, so you can't really create any complex scripts.
    I would love to have some more information as to how sh works on Android but I did manage to get this to work with the following:

    vpn-up.sh: Place this in /system/xbin (I created this directory as part of one of the suggestions on another thread).
    Code:
    /system/bin/ifconfig $1 $4 netmask $5
    OpenVPN Config Options:
    Code:
    script-security 2
    up "/system/bin/sh /system/xbin/vpn-up.sh"
    
    I specifically did not use ifconfig-noexec as I wasn't sure how to setup the MTUs on Android's version and what not so I wanted OpenVPN to at least try and execute ifconfig on it's own, and let me overwrite the values later. "script-security 2" is required to allow OpenVPN to execute shell scripts and pass variables to them. Again, sicne I could not use a shebang, I cannot simply specify "/system/xbin/vpn-up.sh", which is why I have to run "/system/bin/sh" with the script as the argument. The command must be enclosed in quotes.

    After doing this I was able to correctly start up my vpn from the GUI and get the correct IP address.

    Also, you may already know this, but newer versions of TunnelDroid will insmod tun.ko for you if you specify where you put the module.
     
  11. natediddy1120

    natediddy1120 Silver Member

    Joined:
    Jan 4, 2010
    Messages:
    3,180
    Likes Received:
    0
    Trophy Points:
    101
    Location:
    ???
    Ratings:
    +0
    Sorry, but what is OpenVPN? Is it like a tether program?
     
  12. webacoustics

    webacoustics Member

    Joined:
    Dec 20, 2009
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Brooklyn, NY
    Ratings:
    +0
    The wifi tether kernel has tun support built in. No need for tun.ko.
     
  13. Nox

    Nox New Member

    Joined:
    Jan 27, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Ratings:
    +0
    As it turns out, my problems with the scripts were actually related to my text editor (Text Edit from the Market) saving the script with DOS line endings rather than Unix line endings. This caused an extra line feed character on each line confusing sh, which is why my one line script worked. I ended up installing busybox which allowed me to utilize all of my favorite GNU tools. I highly recommend installing busybox for anyone that plans to do any sort of Droid hacking. I'm sure it comes with most ROMs but I'm not ready to mess with those yet.

    Busybox for android

    http://openvpn.net/

    VPN = Virtual Private Network
     
  14. iamgeniusrnti

    iamgeniusrnti Member

    Joined:
    Feb 22, 2010
    Messages:
    39
    Likes Received:
    0
    Trophy Points:
    6
    Ratings:
    +0
    Tun or Tap

    I can't get the damn to work. I am using OpenVPN settings as I could not find TunnelDroid on the market. But it does install the TUN driver.

    Mine negotiates and connects to the server but won't do anything beyond that. I can't access anything on my network. See here for details: OpenVPN Support Forum • View topic - Help??

    I am using it as a TAP, is this wrong?
     
  15. BlackHoleSlam

    BlackHoleSlam Member

    Joined:
    May 29, 2010
    Messages:
    797
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    toms river NJ
    Ratings:
    +0
    I agree lolz




    Sent from my Droid using Tapatalk
     
Search tags for this page
android tun interface
,
config tun=y
,
has anybody got tap openvpn to work on android
,
openvpn android tun.ko problem
,

openvpn droid

,
the tun/tap driver for android
,
tun.ko
,
tun.ko installer en motorola xt914
,
tun.ko samsung y ll
,
where is modprobe.conf in android