Results 1 to 12 of 12
- 03-31-2011, 03:20 PM
Thread Author #1
Thunderbolt OpenVPN Howto
I was asked to post how I got the OpenVPN client working on my Thunderbolt with stock rom and kernel so here goes:
1) Root your phone and verify su is working.
2) Install the BusyBox Installer from the Market. When you run the installer, install version 1.18.4 into /system/xbin
3) Remount /system with read/write privileges using adb shell as root:
4) Symlink /system/xbin to /system/xbin/bb from adb shell as root:mount -o remount,rw -t ext3 /dev/block/mmcblk0p25 /system
(this may be an unnecessary step)ln -s /system/xbin /system/xbin/bb
5) Push the tun.ko module from my other post to /system/lib/modules:
File attached as well.adb push tun.ko /system/lib/modules
6) Chmod the tun.ko module, load the module and verify it loaded correctly (from adb shell as root):
lsmod should output should contain something like "tun 11171 0 - Live 0xbf005000"chmod 644 /system/lib/modules/tun.ko
insmod /system/lib/modules/tun.ko
lsmod
7) Install 'OpenVPN Settings' and 'OpenVPN Installer'. We will be replacing the openvpn binary from the installer with another one so it may not be necessary to install 'OpenVPN Installer' at all.
8) Place your openvpn config files (.ovpn, .key and .p12) in /sdcard/openvpn.
9) Replace the openvpn binary in /system/xbin with the one located
From adb shell as root:adb push openvpn-static-2.1.1 /sdcard
File repackaged and attached as well.cp /sdcard/openvpn-static-2.1.1 /system/xbin
cd /system/xbin
mv openvpn openvpn.old
mv openvpn-static-2.1.1 openvpn
10) Start up 'OpenVPN Settings' and open the Advanced Menu:
-check the box for load tun kernel module
-Configure TUN module settings to use insmod with /system/lib/modules/tun.ko as the path
-check the box for 'Fix HTC Routes'
11) Turn on OpenVPN and connect.
12) Edited copy of my client config:
dev tun
dev-node /dev/tun
persist-tun
persist-key
proto udp
cipher AES-128-CBC
tls-client
client
resolv-retry infinite
remote your_server_name 1194
auth-user-pass password.txt <--insecure, remove after testing
pkcs12 your_config_name.p12
tls-auth your_config_name.key 1
13) Troubleshooting
-netcfg command should show tun0 as up and with an ip from your vpn subnet
-'cat /proc/net/route' should show one or more entries for tun0 depending on your configuration
This is my first Android phone so I am by no means an expert.
I have not had anyone else test this yet but it is working for me including DNS and routing. I'd be happy to modify my post if anyone has any suggestions or additions.Thanked by 3: - 04-25-2011, 02:12 PM #2
Tried this tun.ko on stock (2.6.32.21-gb05544a), rooted TB and using VPN Connections (v.99) to a Cisco ASA5510 firewall.
VPN Tunnel created and ASA shows authetication (group and user name/password passed properly), however, it will not pass any data AND ASA log begins to show "Unsupported message length of 0" shortly after tunnel creation.
The ASA configuation is solid and I have numerous standard Cisco VPN clients, one (1) iPhone 4, two (2) iPad's, two (2) Droid X's (stock froyo but rooted, running VPN Connections (v.99)) and all work without issue.
Is there something I'm missing or is it that this tun.ko is compiled for a slightly older TB OS version?
FWIW: I placed insmod withing the inti.rc file (as I did on the Droid X's) and it is launched at time of phone boot. - 04-25-2011, 03:44 PM
Thread Author #3
- 04-25-2011, 03:59 PM #4
In looking at the ASA logs, I noticed the following using this tun.ko:
Group = OVPN, Username = xxxx, IP = 16.xxx.xxx.xxx, Client Type: Linux Client Application Version: ERSION
Interesting?
EDIT
Posted as you posted. How do I get logging on vpnc? There is only an option "VPNC FLAGs" and nothing else.Last edited by Simace; 04-25-2011 at 04:04 PM.
- 04-25-2011, 04:22 PM #5
/data/data/org.codeandroid.vpnc_frontend/files/vpnc --script /data/data/org.codeandroid.vpnc_frontend/files/vpnc-script --no-detach
Enter IPSec gateway address:
190.xxx.xxx.xxx
Enter IPSec ID for 190.xxx.xxx.xxx:
VPNC1
Enter IPSec secret for :
xxxxxxxx
Enter username for 190.xxx.xxx.xxx:
xxxx
Enter password for :
*********
process stderr
vpnc still trying to connect. Will check again in 500 milliseconds
which: not found
which: not found
which: not found
process stderr which: not found
which: not found
which: not found
vpnc still trying to connect. Will check again in 500 milliseconds
vpnc still trying to connect. Will check again in 500 milliseconds
vpnc still trying to connect. Will check again in 500 milliseconds
vpnc still trying to connect. Will check again in 500 milliseconds
vpnc still trying to connect. Will check again in 500 milliseconds
vpnc still trying to connect. Will check again in 500 milliseconds
vpnc still trying to connect. Will check again in 500 milliseconds
vpnc still trying to connect. Will check again in 500 milliseconds
vpnc still trying to connect. Will check again in 500 milliseconds
Invalid argument
Invalid argument
Invalid argument
Invalid argument
Invalid argument
Invalid argument
Invalid argument
Invalid argument
backing up dns and resolve.conf
vpnc-script ran to completion
process stdout Invalid argument
Invalid argument
Invalid argument
Invalid argument
Invalid argument
Invalid argument
Invalid argument
Invalid argument
backing up dns and resolve.conf
vpnc-script ran to completion
which: not found
which: not found
which: not found
: permission denied
cp: can't stat '/etc/resolv.conf': No such file or directory
vpnc[10658]: can't open pidfile /var/run/vpnc/pid for writing
process stderr which: not found
which: not found
which: not found
: permission denied
cp: can't stat '/etc/resolv.conf': No such file or directory
vpnc[10658]: can't open pidfile /var/run/vpnc/pid for writing
Connect string detected! - 04-25-2011, 04:34 PM
Thread Author #6
I had the same issue with the command 'which', I rolled back busybox 1.17 since 1.18 does not seem to have it. You'll also want to change your pidfile to something on /mnt/sdcard or some other valid location that is writable.
Adding the following vpnc flags will give you more verbose output and change the pid file location:
--debug 1 --pid-file /sdcard/vpnc-pid
(debug level can be set from 1 to 99)
You may also want to try running vpnc manually from an adb shell. Just copy the command string from the log with the addition of the flags I mentioned above.
Check issue 124, , I based my vpnc script modifications on the file attached to the first post.Last edited by zetarhopike; 04-25-2011 at 04:41 PM.
- 04-25-2011, 04:40 PM
Thread Author #7
- 04-25-2011, 04:42 PM #8
- 04-25-2011, 04:49 PM
Thread Author #9
Oh, I understand. I assume you are questioning the client application version string, I have no idea what ERSION is.
I get something to the affect of "Client Application Version: Unknown" when I connect but I also get that when I connect with vpnc from my laptop (Gentoo). I do not have access to the logs personally but I can get a copy if needed.
EDIT: I should have some time to test this further tonight, I'll post some more info if I make more progress.Last edited by zetarhopike; 04-25-2011 at 04:55 PM.
- 04-25-2011, 05:49 PM #10
I changed busybox to 1.17 and the WHICH errors went away (but an "rmnet" error showed up) and I used the --debug 1 --pid-file /sdcard/vpnc flag which got rid of the previous premissions denied on the pid file.
Here's what the log looks like now:
process stderr
vpnc still trying to connect. Will check again in 500 milliseconds
vpnc still trying to connect. Will check again in 500 milliseconds
backing up dns and resolve.conf
vpnc-script ran to completion
process stdout backing up dns and resolve.conf
vpnc-script ran to completion
Device "rmnet" does not exist.
cp: can't stat '/etc/resolv.conf': No such file or directory
process stderr Device "rmnet" does not exist.
cp: can't stat '/etc/resolv.conf': No such file or directory
Connect string detected!
Even though the tunnel is up and the ASA shows the connection (pass phase 2), it still begins to show "Unsupported message length of 0" and there is no data to/from the tunnel to the phone. - 04-26-2011, 12:07 AM #11
Replaced the vpnc-script (/data/data/org.codeandroid.vpnc_frontend/files) file with the one found and now eveything is working as it should!
Excellent!
NOTE: I checked the log and notice that it still records the "Device "rmnet" does not exist.", however, the vpn tunnel is created and data is being passed. Any ideas on this "rmnet" message?Last edited by Simace; 04-26-2011 at 12:12 AM.
- 07-02-2011, 11:44 PM #12


Reply


































