VPNC on android

Search This thread

Phlogiston

Senior Member
Nov 5, 2008
110
0
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.
 

Phlogiston

Senior Member
Nov 5, 2008
110
0
Ah now I remember, I created a symlink to get that fixed.

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

Not sure atm.
 

Phlogiston

Senior Member
Nov 5, 2008
110
0
Thats exactly what I reported.. I copied the script and the error is gone, but the apps still don't use the tunnel.
 

Phlogiston

Senior Member
Nov 5, 2008
110
0
works

hey guys I got it working, here are the steps:

1) Donwload and unpack: http://code.google.com/p/get-a-robot-vpnc/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 :)
 

Phlogiston

Senior Member
Nov 5, 2008
110
0
You sir are the man! That worked perfectly :D 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 :cool:
 

Ungamedplayer

Member
May 4, 2009
27
2
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 :cool:



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.
 
Last edited:

prscott1

Senior Member
Nov 5, 2007
807
23
Houston
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.

:)
 

Phlogiston

Senior Member
Nov 5, 2008
110
0
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.

No problem man :) I hope you can fix those small issues we ran into. (Like the device link or the strange mkdir /sdcard/vpnc problem)

I think thats a good idea with the pref stuff. It would be nice to set the vpn automatically turning on for certain wifi access points while having it disabled for normal EDGE/3G connection. (At least thats my use scenario)
 

N23

Senior Member
Mar 29, 2007
180
22
What do i need to install it on a rooted CRB17 / CRB43? (no ADP release...)

There is no modprobe, uname etc... or i'm just looking at the wrong place ?

Thank you very much!
 

N23

Senior Member
Mar 29, 2007
180
22
Got it working!
Damn nice work!

I have just a problem with the dns-servers, just internal domains are working - no google.com etc. :(

Can't wait to see a easy usable gui version with dns-support! Keep up the good work!
 

Ungamedplayer

Member
May 4, 2009
27
2
Got it working!
Damn nice work!

I have just a problem with the dns-servers, just internal domains are working - no google.com etc. :(

Can't wait to see a easy usable gui version with dns-support! Keep up the good work!

Just wondering, do you know if the same internal servers work when resolving external DNS from inside the network ?
 

mlevin

Senior Member
Dec 8, 2008
323
6
Fairfax, VA
Everything seemed to be going fine and then I got this:

Code:
# /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
/data/data/org.codeandroid.vpnc/bin/vpnc was built without openssl: Can't do hybrid or cert mode.
#

Any suggestions?

EDIT: Ok, got a lot further. Commented out the "IKE authmode hybrid" line as I read somewhere when using Cisco, and then I got this:

Code:
# /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

vpnc version ERSION
ANDROID_ASSETS=/system/app
ANDROID_BOOTLOGO=1
ANDROID_DATA=/data
ANDROID_PROPERTY_WORKSPACE=10,32768
ANDROID_ROOT=/system
BOOTCLASSPATH=/system/framework/core.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar
EXTERNAL_STORAGE=/sdcard
LD_LIBRARY_PATH=/system/lib
PATH=/usr/bin:/usr/sbin:/bin:/sbin:/system/sbin:/system/bin:/system/xbin:/system/xbin/bb:/data/local/bin
reason=pre-init
+ PATH=/sbin:/usr/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/system/sbin:/system/bin:/system/xbin:/system/xbin/bb:/data/local/bin
+ RUNTIME_DATA=/sdcard/vpnc
+ PREVIOUS_DNS_SETTINGS= /sdcard/vpnc/previous_dns_settings
/data/data/org.codeandroid.vpnc/etc/vpnc/vpnc-script: /sdcard/vpnc/previous_dns_settings: not found
+ uname -s
+ OS=Linux
+ RESOLV_CONF_BACKUP=/sdcard/vpnc/resolv.conf-backup
+ FULL_SCRIPTNAME=/system/bin/vpnc
+ basename /system/bin/vpnc
+ SCRIPTNAME=vpnc
+ [ ! -d /sdcard/vpnc ]
+ which ip
+ grep ^/
+ IPROUTE=/system/xbin/bb/ip
+ which ifconfig
+ grep ^/
+ IFCONFIG=/system/bin/ifconfig
+ which route
+ grep ^/
+ ROUTE=/system/bin/route
+ ifconfig_syntax_ptp=pointopoint
+ route_syntax_gw=gw
+ route_syntax_del=del
+ route_syntax_netmask=netmask
+ MODIFYRESOLVCONF=modify_resolvconf_android
+ RESTORERESOLVCONF=restore_resolvconf_android
+ [ -z pre-init ]
+ do_pre_init
+ readlink /dev/net/tun
+ [ /dev/tun = misc/net/tun -a ! -e /dev/net/misc/net/tun -a -e /dev/misc/net/tun ]
+ [ ! -e /dev/net/tun ]
+ exit 0
IKE SA selected psk+xauth-3des-md5
NAT status: this end behind NAT? YES -- remote end behind NAT? no
no response from target
#

Now can anyone help?

EDIT (again): Works great on wifi, won't connect via T-Mo 3G. Are they blocking it? Blarg...
 
Last edited:

mlevin

Senior Member
Dec 8, 2008
323
6
Fairfax, VA
It works ok for me on T-Mobile Edge network (albeit slower than crap). I was getting some message last week when messing with it about "no response from target" but it seemed to work ok for me today. Very strange :confused:

Yeah, looks like I just had a bad connection. It all works now! I made a gscript out of it, too.

Not sure how to stop it nicely, so I just did a "killall vpnc" and that did it :)
 

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    Introduction

    This is the first release of an installable package to allow google android phones to connect to Cisco like VPN concentrators.
    Details

    The installing phone will require:

    * Root user privileges on the phone.
    * /dev/tun file
    * Kernel with tun support (or tun module). (cyanogen should be good)
    * A cisco, nortel or freeswan ipsec server to connect to.

    How To
    Installing this version

    This is available in the android market as a free application. It should be called VPN Connections. (Not sure where it will be listed as yet).

    The latest version of the application can also be downloaded from here and installed using adb.
    Reporting bugs

    Please inform us which ROM and version that you are using, if the /dev/tun exists, its permissions, and the output of logcat from a boot, also the version of this application that you are running.

    If your ROM and version are already reported in the issue list, please comment in the thread as there has been some inconsistencies in reports.

    Please be very careful when lodging a bug as it may contain company confidential information. Be sure to strip any secrets or passwords from the configuration files or debugging information.

    http://code.google.com/p/get-a-robot-vpnc/issues/list
    Known issues

    May need to load the tun module manually first.
    Usernames can not contain the @ symbol.
    Does not currently work with one time pass devices (Rsa keys).
    1
    vpn connects, but apps still use eth0

    Hello!

    I tried VPNC, and it looks like it can connect to the company VPN, tun0 has a correct IP address, routing is in place (looking with route -n), everything looks fine, but if i traceroute to an IP inside the company LAN, it wants to go through eth0.

    Code:
    vpnc version ERSION
    IKE SA selected psk+xauth-aes128-sha1
    NAT status: this end behind NAT? YES -- remote end behind NAT? no
    got address 9.12.227.234
    backing up dns and resolve.conf
    cp: can't stat '/etc/resolv.conf': No such file or directory
    vpnc-script ran to completion
    IPSEC SA selected aes256-sha1
    VPNC started in foreground...

    That resolve.conf error does nothing to do with issue, or ?

    Pinging a company network IP with ping -I tun0 works!
    So it seems i'm really connected, there is only an issu with the routing... :(

    Can you please help me with this ? I really would like to make this work, but i'm stuck here....



    SOLVED: I found this: ip ru del table wifi (if i'm on wifi) This deletes the routing table of the wifi, which is before the local table, so that was used. When i delete it, everything works, even DNS (which was a big surprise :D )
    To set back the old routing settings, turn on and then off the airplane mode.