yashsingh1/xdaforums huggingface dataset:
[Android Software Development] teknologist:
Force closes on hero when hitting find to import config file

title says it all ...have installed the libs/bin in /system/lib and /system/bin (actually I already had libssl and libcrypto)

installed the monitor apk and everytime I got to settings import file -> Find the app force closes.. :-(

Can anyone help ?
[Android Software Development] Ather:
Moved to the New Forum :)

Android software development
[Android Software Development] rogro82:
Im one of the opensource OpenVPN ALS developers ( used to be adito/ssl explorer ). If you need any help on RADIUS or something more basic just send me a pm.
[Android Software Development] ChefCB:
OpenVPN GUI

the VPNMonitor even not works for me, it crashed if i'm trying to import a config file.

I wrote my own OpenVPN GUI and for about 4 hours it's on the android market.

More informations about it can be found on my page at http://www.blank-online.eu/android/openvpn_gui/

unfortunately my page only is in german so I'll give a short summary:

it asks you to download openvpn binary file incl. tun.ko module if needed.

then it may does a wget and chmod and ln -s (because of ifconfig and route)

You can edit the path to your openvpn file

yout can set the path where your configfiles are

and easily start/stop openvpn connections via checkboxes...

i think it became a very nice app :-)

i love it :-)

i'm looking forward to your feedback!!
[Android Software Development] cvandeplas:
Another discussion about this is going-on on MoDaCo.

http://android.modaco.com/content/software/291919/openvpn-on-android/

I also have released an OpenVPN GUI for Android.

The the code is completely opensource, so you can check that I added no backdoors, or you could help fixing bugs by sending patches ;-)

The application can currently:

- Create and edit configurations

- Connect / Disconnect

- View log and share it ( send by email or other means )

- tunnel notification/status in system tray

I am currently working on the implementation of a password prompt for certificate authentication and user/password authentication.

My goal is to release this feature in a week or so.

You can find a README and the openvpn binaries here: https://sourceforge.net/projects/tunneldroid/files/

(these binaries don't require the ugly 'bb' symlinks that the others published on Git do need (http://github.com/fries/android-external-openvpn)

TunnelDroid is published on the Android Market.

So just do a simple search for it. This will help you to follow the updates.

Please give feedback if it works/doesn't work on your phone.
[Android Software Development] blackplatypus:
If I start an openvpn connection via shell (using my config file) it works, however with your tool it starts to connect and it even establishes a connection, but only a few seconds later it disconnects with the following error:

event_wait_interrupted system call (code=4)

TCP/UDP: Closing socket

SIGTERM[hard] received, process exiting
[Android Software Development] SalvoB:
I have the same problem.

lastConnection.log:

Thu Nov 12 17:17:37 2009 OpenVPN 2.1_rc15 i686-pc-linux-gnu [SSL] [LZO2] [EPOLL] built on Nov 1 2009
Thu Nov 12 17:17:37 2009 WARNING: No server certificate verification method has been enabled. See http://openvpn.net/howto.html#mitm for more info.
Thu Nov 12 17:17:37 2009 NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables
Thu Nov 12 17:17:37 2009 WARNING: file '/sdcard/openvpn/client.key' is group or others accessible
Thu Nov 12 17:17:37 2009 LZO compression initialized
Thu Nov 12 17:17:37 2009 Attempting to establish TCP connection with xx.xx.xx.xx:9000 [nonblock]
Thu Nov 12 17:17:38 2009 TCP connection established with xx.xx.xx.xx:9000
Thu Nov 12 17:17:38 2009 TCPv4_CLIENT link local: [undef]
Thu Nov 12 17:17:38 2009 TCPv4_CLIENT link remote: xx.xx.xx.xx:9000
Thu Nov 12 17:17:57 2009 [server] Peer Connection Initiated with xx.xx.xx.xx:9000
Thu Nov 12 17:17:59 2009 event_wait : Interrupted system call (code=4)
Thu Nov 12 17:17:59 2009 SIGTERM[hard,] received, process exiting
[Android Software Development] cvandeplas:
To prevent freezing your phone when openvpn fails to connect I implemented a 30 seconds connection timeout. (line 97 from the source )

TunnelDroid detects you are connected once the tun0 interface came up.

This will probably be where it has issues on your device.

Could you give me a directory listing of your /sys/class/net/ directory once the tunnel came up?

Once I get the info I'll upload a fixed version.

The good news is that I'm currently implementing openvpn-manager support. This means TunnelDroid will be able to interact with openvpn while it runs in the background and will be able to ask openvpn if he's connected.

The technical stuff on the side this means the following new features:

- prompt for certificate credentials

- prompt for auth credentials

- displaying the status of the connection (CONNECTING,WAIT,AUTH, GET_CONFIG, ASSIGN_IP, ADD_ROUTES, CONNECTED, RECONNECTING, EXITING)

- and probably other things ...
[Android Software Development] SalvoB:
Ok.. Great!

I solved the problem, my interface is tap0, I replaced ..
[Android Software Development] cvandeplas:
If you are using a tap interface you should not change the name in the configfile. The tun and taps are completely different things.

The good news is that I had the same bugreport on MoDaCo forums and I fixed this in the code. I just uploaded a new release with a fix.
[Android Software Development] blackplatypus:
thanks the update fixed the bug, now everything works fine, great tool keep the good work :)
[Android Software Development] rgawenda:
Brilliant! Next feature I'd love is the ability to put a shortcut to an specific vpn config in the desktop (android intents, maybe?).

Also changing the Radio boxes with check boxes, and detecting the state when the app is (re)launched would be a plus.
[Android Software Development] cvandeplas:
I am currently working on implementing the authentication prompts.

Unfortunately my architectural design errors due to my lack of Android development start to come up. (inter-process-gui-events are not that simple when you dont know "the right way"). This results in not being able to show the password prompt the right way (and getting the data back).

Some serious refactoring is required, for example: I need to change the TunnelManager singleton to an Android Service.

Once the credentials dialog thingies are done and stable I'll work on your feature request.

Cheers
[Android Software Development] cvandeplas:
Good news, I just released version 0.7 supporting password prompts.

Update is available ont he Market as TunnelDroid.

To see it in action you will need to REMOVE your HARDCODED passwordfile from the configuration !

Check out the readme: https://sourceforge.net/projects/tunneldroi...README/download
[Android Software Development] falstaff84:
Hi,

I installed TunnelDroid and tried my CyanogenMod's integrated OpenVPN Client. But it didnt worked... I then tried to install the binaries from the SourceForge site, but didn't work either (same output)...

Sat Nov 28 22:30:10 2009 OpenVPN 2.1_rc15 i686-pc-linux-gnu [SSL] [LZO2] [EPOLL] built on Nov 1 2009
Sat Nov 28 22:30:10 2009 WARNING: No server certificate verification method has been enabled. See http://openvpn.net/howto.html#mitm for more info.
Sat Nov 28 22:30:10 2009 NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables
Sat Nov 28 22:30:10 2009 Cannot load certificate file idlewild.crt: error:02001002:system library:fopen:No such file or directory: error:20074002:BIO routines:FILE_CTRL:system lib: error:140AD002:SSL routines:SSL_CTX_use_certificate_file:system lib
Sat Nov 28 22:30:10 2009 Exiting

Any idea?

Thanks

falstaff
[Android Software Development] falstaff84:
OK I could solve the above problem by using absolut paths in the config file:

/sdcard/openvpn/whatever.file

Next problem:

Sat Nov 28 22:46:12 2009 TUN/TAP device tun0 opened
Sat Nov 28 22:46:12 2009 TUN/TAP TX queue length set to 100
Sat Nov 28 22:46:12 2009 /system/xbin/ifconfig tun0 192.168.X.Y pointopoint 192.168.X.Z mtu 1500
Sat Nov 28 22:46:12 2009 Linux ifconfig failed: could not execute external program
Sat Nov 28 22:46:12 2009 Exiting

I looked, there is no /system/xbin/ifconfig, I use CyanogenMod and took the binaries from sf...

Bye

falstaff
[Android Software Development] falstaff84:
OK, solved that one too... I restored the original CyanogenMod binaries, they work fine now...

So another hint would be helpful: Do not use the binaries if you have CyanogenMod... :-)

Bye

falstaff
[Android Software Development] wingmanjd:
Any way of getting this to work on the Fuze running Android? I can't get adb to work since there is no USB debugging (yet).
[Android Software Development] jeibie:
I running into problems with cyanogenmod 4.2.6

In my openvpn config there is a tap0 interface configured (tap is needed for me). But there is no tap device at /dev/ (only tun) and also no tap.to at /system/lib/modules/.

So has someone a running openvpn with a tap device?
[Android Software Development] Clayton619:
Root Permission Required?

Hello,

Do I need to have root permissions in order to install OpenVPN on the TMobile myTouch 3G Smartphone?

If so, how do I get root permissions?

Thanks.....
[Android Software Development] plukacs7:
Hero Openvpn with TunnelDroid - a special problem

I opened a new thread, but maybe someone can answer here... I am not an expert of vpns and networks...

Hero, OpenVPN, StrongVPN and the Big China Mistery

--------------------------------------------------------------------------------

"Well I searched the forums all over the interweb for a week now, and did not find an answer so I post.

I live in China and as part of the Expat Survival Kit I run an OpenVPN service to solve my facebooktwitteryoutoube problems. The provider is strongvpn.com, or other name reliablehosting.com - reliable, they are, and responsive and helpful and everything.

The VPN uses a San Francisco server, so anytime I fire it up on my PC, I have a USA IP, and can access Youtube, Facebook, Twitter, Pandora et al. Bingo.

I struggled days to hack this connection on my Hero, and finally managed, it works, it connects. Apparently.

Now here is the hick:

- I connect on the Hero with TunnelDroid, using my original StrongVPN config file. It takes some time, but usually connects, either WiFi and Edge.

- I check my external IP, it's the good old Frisco one, I seem good to go

- I can surf sites like e.g. Amnesty International, impossible without VPN. I can use Pandora, so definitely I have US IP. Eventually if there is an embedded Youtube vid somewhere, I even can see and try to start it (although it's dead slow)!

- But, none of the social integration features work. I can not log in into twitter, facebook etc, and when I try to visit those sites with the browser, I have the same result as without VPN, nada. Timeout, service unavailable, technical problem, you name it

Now, if there is any developer / network or VPN expert / GFW operator / Google guru around... I really want to understand exactly what the problem can be - that would help some fellow Hero owners here in China

I changed the "hosts" file that I found on some forums... I tried to boost the process with some web proxy... Tried everything - nothing works.

How is it possible that I'm behind a VPN, I have American IP reported by any software you can imagine, and still I'm blocked, while everything works fine on the PC with the same VPN connection???

I can live without these apps and sites on my Hero...but can not live without finding out the truth "

Thanks...
[Android Software Development] slackert:
wget binary required by openvpn-gui

Has anyone documented the steps for installing wget? wget gets called by the openvpn gui when first run.

Do you have to go through the adp push foo, chmod foo bit? Can you lust create /usr/local/bin on the sdcard and add it to the path or something (copy binaries there)? I'm new to mucking with android....
[Android Software Development] Fizzyflaskan:
Hi, I installed openssl binarys and got tunneldroid to connect to the server and verify the certs , but then it says linux ifconfig failed. So it seems that the ifconfig binarys are gone is that correct? Cant seem to find them (seems like others can find them in system/bin/ ). Where to get this then?

Got it , dont install the binaries. Damn mee should have read before i did that changes.

Now I get connected but the phone doesnt seem to have internet after this :S Is it because I use tap or something like that ? dont get any errors so doesnt know what the problem is (VPN server works greate from computers). Doesnt seem that it get dns servers properly....

Sun Dec 6 00:06:39 2009 Initialization Sequence Completed
Sun Dec 6 00:06:39 2009 MANAGEMENT: >STATE:1260054399,CONNECTED,SUCCESS,xxx.xxx.xxx.xxx,xx.xxx.xxx.xxx
Sun Dec 6 00:08:11 2009 MANAGEMENT: Client disconnected

thats what it says in the end, just seems to disconet by no reason...
[Android Software Development] sancho_sk:
Hi.

Great to see the OpenVPN working on Android with a very nice GUI for such.

Anyhow, I have a tattoo phone with no option to root (yet?), so I'd like to ask:

Is there any chance to build the openVPN binary and GUI so that it does not require the root access?
[Android Software Development] synfin:
They use several techniques to block traffic. VPN get's around most (filtering/ip blocking) but it may have an issue getting around DNS poisoning. All the sites you seem to have issues connecting to are DNS poisoned in one way or another. This means that all legit DNS servers in china give you a fake ip address for the host name.

To test this out try to manually set the ipaddress for the host login.facebook.com using your host file(the only host on facebook which is currently poisoned that I'm aware of). Alternatively you could ensure that DNS requests are being routed to a foreign dns server - over the vpn connection and find a way to flush your DNS cache after you've established the connection - or in some other manner. I'm new to android but I'll try to update this post when I discover android specific methods to solve this issue. Hope this helps.
[Android Software Development] Fizzyflaskan:
Got it to work now (just wifi), but doesnt seem to work over 3g is that right?
[Android Software Development] kilascay:
yeah that happens for me too, i think its something to do with the system config when running off 3g. i was able to tether the phone to my laptop then vpn from there. but no go vpn+3g on the phone.
[Android Software Development] awsy44:
I got it working, go to your router, then make the phone DMZ, which means it doesn't go through the routers DNS. (for me D-LINK has it in settings/firewall settings/ enable DMZ)

On your phone go to wireless settings and advanced, put the DNS 1 and 2 are 8.8.8.8 and 8.8.4.4 for google public dns, thats how fb and twitter are working perfect.
[Android Software Development] mushroom1:
I just tried TunnelDroid and it works fine.

However, it seems to only route packet with VPN destination via OpenVPN. (Say 192.168.2.0/24) But all other traffics (google.com, yahoo.com) is still routed via phone's default.

Did I do something wrong, or is there anyway to get around this?
[Android Software Development] rgawenda:
That's the way it's intended to be. If you want all your IP traffic going to the VPN just have a look at the routes and set the default gateway there.
[Android Software Development] Gawis:
not sure but isn't this fixed by adding

redirect-gateway def1

to the client config file?
[Android Software Development] mushroom1:
Thanks for the tips. I didn't know about that config option.

I was able to push default gateway from the server. Now, the next problem is that when the connection is made with all packets routed via VPN, the default DNS on N1 is still T-Mobile 3G's (10.184.80.242:53) instead of VPN's.

I added

push "dhcp-option DNS 4.4.4.4"

to the server, but the phone still use T-Mo's.

Is there any way to get around this?
[Android Software Development] Gawis:
hi mushroom1, could you please share what exact line you added to your serverconfig file?

I'm interested to get the same thing working and thought the redirect gateway did the same (it's all kinda new to me :) )
[Android Software Development] mushroom1:
Sure..

I added

push "redirect-gateway def1"

to server config file.

From what I understand, you should be able to add "redirect-gateway def1" into client config to get the same result. However, that doesn't seem to work with Tunneldroid/OpenVPN
[Android Software Development] Gawis:
thanks!

I was using the edit in the client file and it seemed to work ok

could you please tell me what I need to do to test if everything goes through the tunnel (.com, dns, ...).

thanks again and sorry for being a pain :)
[Android Software Development] mushroom1:
try www.whatismyip.com

If it's showing T-Mo or your carrier's IP (use whois.sc to find out), then it means it's not going through your VPN. Otherwise, if it's going through your VPN, you'll see your VPN outbound IP
[Android Software Development] Gawis:
thanks for the reply!

I tested without tunnel and I got my carriers IP, then I tried with a tunnel without the "redirect-gateway" in client config and I still got my carriers IP.

Then I tested with a tunnel with "redirect-gateway" in client config and I got my home ISP IP address.

so for me it seems to work fine when only modifying the client config.

thanks again for the info!
[Android Software Development] rgawenda:
Do an ifconfig in the terminal emulator and ping both ends of the VPN. Leaveing default routes untouched doesn't mean the VPN routing is correctly stablished.
[Android Software Development] rks752:
// gw

$ ping -c 3 -w 5 5.6.0.1

100% packet-loss

// ptp

$ ping -c 3 -w 5 5.6.0.5

100% packet-loss

// ext. net. test

$ ping -c 3 -w 5 external-VPN-IP

0% packet-loss
[Android Software Development] rgawenda:
are the routes correct?
[Android Software Development] rks752:
As far as I can see, yes.

# ./route

Kernel IP routing table

Destination Gateway Genmask Flags Metric Ref Use Iface

5.6.0.5 * 255.255.255.255 UH 0 0 0 tun0

5.6.0.0 5.6.0.5 255.255.255.0 UG 0 0 0 tun0

192.168.10.0 * 255.255.255.0 U 0 0 0 tiwlan0

default 192.168.10.2 0.0.0.0 UG 0 0 0 tiwlan0

From the logs (manually bringing it up)

Wed Apr 28 10:57:30 2010 ROUTE default_gateway=192.168.10.2

Wed Apr 28 10:57:30 2010 TUN/TAP device tun0 opened

Wed Apr 28 10:57:30 2010 TUN/TAP TX queue length set to 100

Wed Apr 28 10:57:30 2010 /system/xbin/bb/ifconfig tun0 5.6.0.6 pointopoint 5.6.0.5 mtu 1500

Wed Apr 28 10:57:30 2010 /system/xbin/bb/route add -net 5.6.0.0 netmask 255.255.255.0 gw 5.6.0.5

Wed Apr 28 10:57:30 2010 Initialization Sequence Completed
[Android Software Development] joephein:
DNS fix

I found that I needed to click the "Fix DNS" button every time I change GPRS network because the DNS settings are overwritten by T-mobile. For some reason the T-Mobile DNS Servers do not work while on a VPN connection.

So I wrote a simple shell script and assigned it to run on screen unlock event in Tasker. Maybe this can be of some use to other users as well.

#!/system/bin/sh
su -c "setprop net.dns1 8.8.8.8"
su -c "setprop net.dns2 8.8.4.4"
su -c "setprop net.rmnet0.dns1 8.8.8.8"
su -c "setprop net.rmnet0.dns2 8.8.4.4"
pid=$(ps|grep com.android.phone|awk '{print $2}')
su -c "setprop net.dns1.$pid 8.8.8.8"
su -c "setprop net.dns2.$pid 8.8.4.4"
unset $pid
exit()
[Android Software Development] bahman2000:
LamaZ

Thanks for the tips. You pointed me in the right direction. However I think you over-complicated this a little bit.

I am on N1 Froyo (FRF91) with BusyBox and root.

This is what I did:

Install openvpn-installer (it installs the binary). During installation point to busybox (ifconfig/route) at: /system/xbin/bb

Create the symbolic links that you mentioned:

./adb shell ln -s /system/xbin/ifconfig /system/xbin/bb/ifconfig
./adb shell ln -s /system/xbin/route /system/xbin/bb/route

I did not need to copy the binary like you suggested.

I did everything else required for openvpn-settings (conf and keys in /sdcard/openvpn, tun.ko in a reachable location).

I am not sure why you are deleting a route. A route is there either because your server or your client request it.

I am also not sure why you needed tun.ko if you're using tap. I'm using tun.

Everything works, just needed the symbolic links!
[Android Software Development] Gawis:
thanks a lot to both for your replies this will surely come in handy the next time I have a rom that doesn't have OpenVPN in it!
[Android Software Development] lamaz:
Glad to see it worked for you. I tried using the openvpn-installer with no success. I tried installing it in various locations. I'm glad to see there was an easier route.

The reason I had to delete a route is probably due to my server configuration file which will push DNS, dhcp and force all traffic through it. I noticed that my Mac and Linux Machines didn't have that route entry after connecting. If I leave the route I cannot connect anywhere.

The tun.ko is absolutely necessary for a tap device. You will get errors without it.

Glad to help out

-LamaZ
[Android Software Development] GldRush98:
My tap connection is connecting, but the phone is not setting it's IP right.

I can see my vpn server telling the phone what to do, but the phone seems to have some weird issue.

Anyone every run in to this?

D/OpenVPN-DaemonMonitor[/sdcard/openvpn/Plutoserver.ovpn]-daemon-stdout( 923):Thu Jul 15 00:52:27 2010 PUSH: Received control message: 'PUSH_REPLY,route-gateway 10.100.100.200,ping 10,ping-restart 120,ifconfig 10.100.100.204 255.255.255.0'
D/OpenVPN-DaemonMonitor[/sdcard/openvpn/Plutoserver.ovpn]-daemon-stdout( 923):Thu Jul 15 00:52:27 2010 Options error: Unrecognized option or missing parameter(s) in [PUSH-OPTIONS]:4: ifconfig (2.1.1)

In the OVPN Settings panel under my connection it says "Connected to xx.xx.xx.xx as" and it's just blank after the as. I am pretty sure that is where it should be listing the IP, but for some reason it isn't setting right.
[Android Software Development] GldRush98:
Tried a tun connection, same issue :(

Connects, but the address doesn't assign
[Android Software Development] Zal81:
Fixed

I was having the same problem, but finally figured it out. It seems the binary from OpenVPN installer has a bug or incompatibility with the stock FRF91.

1) Download github.com/downloads/fries/android-external-openvpn/openvpn-static-2.1.1.bz2

2) Extract and rename the file to openvpn

3) use adb push to copy the file from your computer to your phone's /system/xbin directory (I extracted to c:\temp on my local, so you will need to change the c:\temp\ part to your local directory)

adb push c:\temp\openvpn /system/xbin

4) open up an adb shell

5) make the newly copied openvpn executable

chmod 777 /system/xbin/openvpn

6) this openvpn looks for the system binaries in the /system/xbin/bb directory, so create a symlink to where they are really located at on your phone.

ln -s /system/xbin /system/xbin/bb

I found the info for the above solution from code.google.com/p/android-openvpn-settings/issues/detail?id=26

This binary does seem to have a problem with passphase protected certificates, but worked fine with a certificate without a passphase. After a reboot it seems to work fine with both passphase and non-passphase certificates.
[Android Software Development] D!T:
I did all of the above (download openvpn-static;rename;push to /system/xbin; make 777; created symlink), but keep getting "FATAL: Cannot allocate TUN/TAP dev dynamically"

I'm using a TAP interface on rooted, (otherwise) stock Froyo N1 with busbybox installed.

Sadly, I don't know OpenVPN much, so might someone be able to suggest something I'm missing?
[Android Software Development] jwickers_1234:
You are missing the tun.ko (or is it tap.ko when using tap ? i only use tun , not sure) module. You need to find one that works with your kernel, and push it to /system/lib/modules (or elsewhere actually) then set in the openvpn config the options to load it (or load manually in console as root: insmod <path>/tun.ko)