FORUMS
Remove All Ads from XDA
H10 Turbo

VPNC on android

27 posts
Thanks Meter: 2
 
By Ungamedplayer, Junior Member on 4th May 2009, 11:15 AM
Post Reply Email Thread
20th May 2009, 06:39 PM |#21  
Senior Member
Thanks Meter: 0
 
More
Quote:
Originally Posted by kwkard

When I try to connect I get the following error:

Code:
# ./vpnc /data/data/org.codeandroid.vpnc/etc/vpnc/vpnc.conf
./vpnc /data/data/org.codeandroid.vpnc/etc/vpnc/vpnc.conf
/etc/vpnc/vpnc-script: not found
can't open /dev/net/tun, check that it is either device char 10 200 or (with D
FS) a symlink to ../misc/net/tun (not misc/net/tun): No such file or directory
can't initialise tunnel interface: No such file or directory
#
I got the same thing in Debian when after downloading the source, compiling, and installing.

I downloaded:
http://code.google.com/p/android-vpnc/

and I see a tun.ko file. Do I need to do something with that? I also loaded up the above mentioned package in the SDK and ran it but after giving it root permissions it force closes. Any ideas?

Edit: Forgot to mention I'm rooted using JF1.5 ROM


You need to load that module with: modprobe -v tun
you can see the loaded kernel modules with lsmod.
 
 
20th May 2009, 07:08 PM |#22  
Junior Member
Thanks Meter: 0
 
More
Strange, I loaded the module, then verified it was there and got the same result:

Code:
# pwd
/data/data/org.codeandroid.vpnc/etc/vpnc
# ls
tun.ko       vpnc-script  vpnc.conf
# modprobe -v tun
# lsmod
tun 11044 0 - Live 0xbf000000
# /data/data/org.codeandroid.vpnc/bin/vpnc /data/data/org.codeandroid.vpnc/etc/vpnc/vpnc.conf
/etc/vpnc/vpnc-script: not found
can't open /dev/net/tun, check that it is either device char 10 200 or (with Dev
FS) a symlink to ../misc/net/tun (not misc/net/tun): No such file or directory
can't initialise tunnel interface: No such file or directory
#
And if I try to install the module:

Code:
# lsmod
# insmod tun.ko
insmod: init_module 'tun.ko' failed (Exec format error)
# lsmod
#

On a separate note, why does my adb shell echo every command I type like so:

Code:
# pwd
pwd
/data/data/org.codeandroid.vpnc/etc/vpnc
# ls
ls
tun.ko       vpnc-script  vpnc.conf
#
20th May 2009, 07:26 PM |#23  
Senior Member
Thanks Meter: 0
 
More
Ah now I remember, I created a symlink to get that fixed.

Something like: ln -s /dev/tun /dev/net/tun

Not sure atm.
20th May 2009, 10:55 PM |#24  
Junior Member
Thanks Meter: 0
 
More
Thanks, that command did do the trick. I am however, getting the error about executing the script. See script below.

Code:
# modprobe -v tun
# lsmod
tun 11044 0 - Live 0xbf000000
# mkdir /dev/net
# ln -s /dev/tun /dev/net/tun
# cd /data/data/org.codeandroid.vpnc/bin
# chmod 777 ../etc/vpnc/vpnc-script
# ./vpnc --debug l --enable-1des --script ../etc/vpnc/vpnc-script ../etc/vpnc/vpnc.conf
../etc/vpnc/vpnc-script: not found
../etc/vpnc/vpnc-script: not found
VPNC started in background (pid: 308)...
# kill 308
# ls ../etc/vpnc/vpnc-script
../etc/vpnc/vpnc-script
#
It seems I am getting connected, but the traffic is not getting tunneled. My guess is because the script doesn't get run. As you can see from the last 'ls' command, the script does exist but it ignored my '--script' argument. Thus:

Code:
# mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
# mkdir /etc/vpnc
# cp /data/data/org.codeandroid.vpnc/etc/vpnc/vpnc-script /etc/vpnc/vpnc-script
# chmod 777 /etc/vpnc/vpnc-script
# ./vpnc --debug l --enable-1des ../etc/vpnc/vpnc.conf
/etc/vpnc/vpnc-script: not found
/etc/vpnc/vpnc-script: not found
VPNC started in background (pid: 343)...
# kill 343
#
Even with the script in the location it specifies, it complains that it's missing. Any ideas?
21st May 2009, 12:38 AM |#25  
Senior Member
Thanks Meter: 0
 
More
Thats exactly what I reported.. I copied the script and the error is gone, but the apps still don't use the tunnel.
21st May 2009, 07:20 PM |#26  
Junior Member
Thanks Meter: 0
 
More
Hmm... I still can't get rid of the error about not finding vpnc-script. Can you post the output of the following two commands?

Code:
ls -l -R /etc/vpnc
ls -l -R /data/data/org.codeandroid.vpnc
21st May 2009, 08:43 PM |#27  
Senior Member
Thanks Meter: 0
 
More
works
hey guys I got it working, here are the steps:

1) Donwload and unpack: http://code.google.com/p/get-a-robot...downloads/list
2) Edit vpnc.conf with your connection settings
3) Change first line of vpnc-script in etc to:
Code:
#!/system/bin/sh
2) push it over to your phone, you are in the top folder with data in it:
Code:
alias as="adb shell"
adb push ./ /
push: ./data/data/org.codeandroid.vpnc/etc/vpnc/vpnc.conf~ -> /data/data/org.codeandroid.vpnc/etc/vpnc/vpnc.conf~
push: ./data/data/org.codeandroid.vpnc/etc/vpnc/vpnc-script -> /data/data/org.codeandroid.vpnc/etc/vpnc/vpnc-script
push: ./data/data/org.codeandroid.vpnc/etc/vpnc/vpnc.conf -> /data/data/org.codeandroid.vpnc/etc/vpnc/vpnc.conf
push: ./data/data/org.codeandroid.vpnc/bin/ifconfig -> /data/data/org.codeandroid.vpnc/bin/ifconfig
push: ./data/data/org.codeandroid.vpnc/bin/route -> /data/data/org.codeandroid.vpnc/bin/route
push: ./data/data/org.codeandroid.vpnc/bin/bb -> /data/data/org.codeandroid.vpnc/bin/bb
push: ./data/data/org.codeandroid.vpnc/bin/vpnc -> /data/data/org.codeandroid.vpnc/bin/vpnc
push: ./data/data/org.codeandroid.vpnc/bin/make-tun-device -> /data/data/org.codeandroid.vpnc/bin/make-tun-device
8 files pushed. 0 files skipped.
611 KB/s (2943952 bytes in 4.705s)
3) Load module and create symlink:
Code:
as modrobe tun
as lsmod
as mkdir /dev/net
as ln -s /dev/tun /dev/net/tun
as mkdir /sdcard/vpnc
4) Start the client:
Code:
as /data/data/org.codeandroid.vpnc/bin/vpnc /data/data/org.codeandroid.vpnc/etc/vpnc/vpnc.conf --script /data/data/org.codeandroid.vpnc/etc/vpnc/vpnc-script --no-detach --debug 1
Good luck

PS: as is an alias set in step 2) which is the same as using adb shell all the time, but its shorter
21st May 2009, 10:45 PM |#28  
Junior Member
Thanks Meter: 0
 
More
You sir are the man! That worked perfectly I tested out my new tunneled connection by going to a site that I knew websense blocks and it was blocked. I always seem to forget about shell scripts need #!/system/bin/sh to be executable. Thanks for your help
21st May 2009, 10:48 PM |#29  
Senior Member
Thanks Meter: 0
 
More
Quote:
Originally Posted by kwkard

You sir are the man! That worked perfectly I tested out my new tunneled connection by going to a site that I knew websense blocks and it was blocked. I always seem to forget about shell scripts need #!/system/bin/sh to be executable. Thanks for your help

Hehe, you're welcome. As far as I heard the gui to this will be ready soon and those bugs should be fixed too. So no more hassle with all that

Another easy way to check if its working: Go to a site that displays your ip address and check whether its different from the one you have without the tunnel
22nd May 2009, 02:20 AM |#30  
OP Junior Member
Thanks Meter: 2
 
More
Quote:
Originally Posted by Phlogiston

Hehe, you're welcome. As far as I heard the gui to this will be ready soon and those bugs should be fixed too. So no more hassle with all that

Another easy way to check if its working: Go to a site that displays your ip address and check whether its different from the one you have without the tunnel



Thanks for helping out with the support P

Another teaser screenshot for those following along http://yfrog.com/0kdevicep , I've moved away from the app style program into a preference style app, so that if google wants to pick it up it slots into the preferences easier.
22nd May 2009, 02:40 AM |#31  
prscott1's Avatar
Senior Member
Flag Houston
Thanks Meter: 22
 
More
Quote:
Originally Posted by Ungamedplayer

Thanks for helping out with the support P

Another teaser screenshot for those following along http://yfrog.com/0kdevicep , I've moved away from the app style program into a preference style app, so that if google wants to pick it up it slots into the preferences easier.

I just stumbled onto this post and really like the teaser on the prefs setup. I'm looking forward to giving this a try. We have a Cisco 3000 concentrator at work that I hope this will work on and allow me access to the "inside" domains.

Post Reply Subscribe to Thread

Tags
android, ipsec, vpnc

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes