OpenVPN with Root - Updated 8/19

SimonTuffGuy

Senior Member
Jun 10, 2010
119
16
0
www.teamoctos.com
For that, you need vpnc instead of openvpn.

I know the problem with using the VPN Connections app is that the tun.ko autoload doesn't work. There are a couple of things you may be able to do as a workaround.

1. Load the module by hand:

insmod /sdcard/openvpn/tun.ko
I'm trying to connect into my company Cisco VPN as well... This was so easy with my iPhone, but I'm going to make it work on my Incredible. :)

I have a GScript command that loads the tun.ko module automatically when I click it. I installed the newest version of Busybox, per the instructions here on the site...

However, I still get a failed to connect.

When I type "ifconfig tap0", it comes back saying "tap0: No such device". Do I need this to be configured for my isco VPN, or is that OpenVPN related only?

Thoughts?
 
Last edited:

gummehbear

Senior Member
Apr 30, 2010
66
0
0
I have an error that i can't figure out. I don't think the ca, cert, and key options have to be the full path, in which case i have no idea why it fails to read the file, that is of course assuming I am reading the error correctly.

Can anyone help me with this?

Code:
# /data/openvpn/openvpn --config /sdcard/openvpn/client.conf
Fri Jul  9 15:46:35 2010 OpenVPN 2.1.1 i686-pc-linux-gnu [SSL] [LZO2] [EPOLL] built on Jun 14 2010
Enter Auth Username:jeff2daizzo
Fri Jul  9 15:46:42 2010 NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables
Fri Jul  9 15:46:42 2010 Cannot load certificate file client.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
Fri Jul  9 15:46:42 2010 Exiting
Code:
client
auth-user-pass
dev tun
proto tcp
remote ldap.server.com 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert client.crt
key client.key
ns-cert-type server
comp-lzo
verb 3
Code:
$ ls /sdcard/openvpn/
openvpn-static
client.conf
tun.ko
ca.crt
client.crt
client.key
Code:
$ ls /data/openvpn/   
openvpn
 

aaronjb

Senior Member
Sep 16, 2009
199
0
0
Note that the CM6 builds don't have the TUN module built into the kernel. Compile your own and load it with insmod, or wait for it to be included in CM6 by default.
 

wraithdu

Senior Member
Aug 28, 2008
284
111
0
The hydra kernels have TUN built in to the kernel. So if you're running a ROM that works with those kernels, you can go that route too.
 

gummehbear

Senior Member
Apr 30, 2010
66
0
0
Has anyone been able to get OpenVPN to work with SkyRaider + Hydra's Kernel? I've been unsuccessful in getting OpenVPN working since upgrading to the android 2.2 leaks.
 

apalyan

New member
Aug 3, 2010
1
0
0
Has anyone been able to get OpenVPN to work with SkyRaider + Hydra's Kernel? I've been unsuccessful in getting OpenVPN working since upgrading to the android 2.2 leaks.
For anyone interested, I've compiled the tun module against HTC's 2.6.32.15 kernel release and tested it successfully running OTA 2.2 (8/1 leak). My kernel version is 2.6.32.15-g5e1ad8b. Just replace your tun.ko file with the attached one and OpenVPN should start working again.

Cheers!
 

Attachments

Last edited:

gummehbear

Senior Member
Apr 30, 2010
66
0
0
For anyone trying to get OpenVPN working on Froyo w/ the hydra kernel and failing miserably, its because you have to load the tun.ko module differently.

Since the kernel is now modular you will have to point openvpn to tun.ko in /system/lib/modules. i.e. - /system/lib/modules/tun.ko

I don't know if this is different for other kernels, but this was the solution i found via ejhart.

For reference: (SSL cert fails)
https://git.unrevoked.com/redmine/issues/14
 

fang0654

Member
Mar 18, 2008
17
0
0
For anyone interested, I've compiled the tun module against HTC's 2.6.32.15 kernel release and tested it successfully running OTA 2.2 (8/1 leak). My kernel version is 2.6.32.15-g5e1ad8b. Just replace your tun.ko file with the attached one and OpenVPN should start working again.

Cheers!
Thanks! I added it to the main post, along with updated (and much easier) instructions for anyone who also has S_OFF.
 

asmozre

Member
Aug 16, 2010
8
0
0
I'm having trouble getting this running on king's newest kernel. I am able to get connected but do not see any ip route once I am connected. Not able to ping any internal ip's after the openvpn connected on the phone either.
 

vossco32

Member
Aug 7, 2006
17
0
0
New 2.2 Rom

The new 2.2 Rom (3.21.605) has a different kernel string then the previous 2 leaks so the tun.ko will not load. Any chance we could get a new one compiled for this new kernel?
 

PokerMunkee

Senior Member
Jun 18, 2010
55
1
0
I'm also having issues getting OpenVPN to work on the official release ROM.

Getting FATAL: Cannot allocate TUN/TAP dev dynamically on the final 2.2 release.
 
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone