OpenVPN on BB .5 - Who has it working?

Discussion in 'Bugless' started by prochobo, Oct 23, 2010.

  1. prochobo
    Offline

    prochobo New Member

    Joined:
    Dec 19, 2009
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    0
    I love this ROM, but have never gotten OpenVPN to work. It doesn't seem like there's a tun.ko driver to load and I can't insmod or modprobe it. I can't find it while doing a search through the file system either.​


    I remember seeing a tun.ko being included in BB in previous version's notes and I was wondering is there any way to get it to work with .5? I've had no problems running it in Cyanogen, but I like BB way better.
  2. Mikobiko
    Offline

    Mikobiko New Member

    Joined:
    Aug 19, 2010
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    0
    Looking for the same thing, I am trying to get openvpn working on my droid, and probably going to end back up with Cyanogen, but really didn't like how slow it ran on my phone.
  3. Jbchow
    Offline

    Jbchow New Member

    Joined:
    Mar 15, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    I have OpenVPN working. The tun adapter should be compiled into the kernel. if it is not feel free to get a p3droid kernel they have the tun adapter compiled into the kernel.
    I am going to assume you have some Android/OpenVPN knowledge. This includes how to generate keys and how to setup your server. If you need help with these steps let me know I can go into far more detail.
    The simple way to get it working is to download the OpenVPN Installer and the OpenVPN Settings both by Friedrich Schäuffelhu. Install OpenVPN Installer and then configure your settings by creating an OpenVPN folder on the root directory of your SD card. My config is listed at the end of this post.
    There is two problems that you can run into with OpenVPN. The first problem is that version that OpenVPN installer installed when I first used it was the newest version which has a bug. From what I have read the bug was created when the locations of the files OpenVPN calls were hard coded. There are two ways to solve this. Downgrade to the previous version or a version which does not have this problem. If you google “openvpn-android-2.1.tar.bz2” you should be able to find the forum where I found most of this information about this bug and download the OpenVPN binary. This should be pushed to the /system/xbin/ folder. The other solution is to create a Symbolic Link from the /system/xbin/ folder to /system/xbin/bb. (Command: ln -s /system/xbin /system/xbin/bb )
    The second problem you will run into is how OpenVPN deals with routing on android. When I setup my server on my windows box, I have it set to push the route, gateway and dns. These commands are not compatible with android. They have to be rewritten and put into the *.ovpn config file. So far I have not bothered to do this because I can’t imagine a time when I would ever want to route all my traffic from my phone to my home local network.

    This is the config. I am using. You will have to modify this script to match how you have your server setup.
    OpenVPN.ovpn

    Client
    Dev tun //(I put in tap because I have a tap setup)
    Proto udp
    Remote (Your outside ip) (Your OpenVPN Port)
    Resolve-Retry 60
    Nobind
    Persist-key
    Persist-tun
    Tls-client
    Tls-auth /sdcard/OpenVPN/ta.key 1
    Ca /sdcard/OpenVPN/ca.crt
    Cert /sdcard/OpenVPN/(Your Cert Name).crt
    Key /sdcard/OpenVPN/(Your key Name).key
    Ns-cert-type server
    Cipher (openvpn cipher you used)
    Comp-lzo
    Verb 3
    Log /sdcard/openvpn/openvpn.log //not needed but very very useful to debug problems
    Log-append /sdcard/openvpn/openvpn.log
    #route-up “/system/bin/sh/sdcard/openvpn/up.sh // noted below


    I was also told I needed an “up.sh” script to fix some sort of routing problem after the OpenVPN connection is disconnected. I am not sure if this script really does anything useful or not but I have included it in case it does something for you.
    You will need to chmod 755 this file in order to be able to execute it.
    UP.sh

    #!/system/bin/sh
    /system/xbin/route del (your outside ip)


    Once you get to this point you should be all configured open OpenVPN Settings and click the OpenVPN check box. You should also see a box next to whatever you named your *.ovpn file. Check that box and OpenVPN Settings will launch openvpn with your config file. To disconnect uncheck the OpenVPN box.

    Hopefully this will get you up and running :-D
    Jbchow
    Last edited: Oct 27, 2010
  4. ZeroBarrier
    Offline

    ZeroBarrier New Member

    Joined:
    Apr 23, 2010
    Messages:
    991
    Likes Received:
    0
    Trophy Points:
    0
    Excellent first post Jbchow. It's hard to find a first poster that has more than just 2 brain cells to rub together! Ha.
  5. Jbchow
    Offline

    Jbchow New Member

    Joined:
    Mar 15, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Thank you,
    I've been around the forums for a while just new to posting for android. (Had a Windows Mobile HTC Touch Pro until the Motorola Droid dancedroid came out. Instant convert - I never want to go back)

    It took me 3 hours to get OpenVPN up and working when I first tried. I'm glad to be able save others the same headache :-D


    I forgot to mentioned this before but if anyone knows the config lines to get the routing working I would love the option. (Although I cant imagine an application where I would need it)
    Last edited: Oct 27, 2010
Search tags for this page
bb 10 openvpn
,
how to setup openvpn on android motorola phone
,
openvpn en bb
,
openvpn for. bb10
,

openvpn no configuration found

,

openvpn settings no configuration found