[Touch CDMA Android Development] mirth18:
I have been trying to get the get-a-robot-vpnc (http://code.google.com/p/get-a-robot-vpnc/) package to work on my HTC Vogue for some time. I am currently running the eclair 2.1 mssmision build.

I have gotten pretty far I think.. but need some help. Here are the steps that I have followed up until now.

1. Compile tun.ko module for Vogue

I followed these instructions to get the vogue kernel locally: http://www.androidonhtc.com/get_involved

After step 5 in that list, make sure to select the "Device Drivers->Network Device Support->Universal TUN/TAP device driver support" (select as M for kernel module)

After step 6, build the kernel modules: "make modules ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-"

2. Put tun.ko onto the vogue permanently

Set the /system partition writable

adb -d shell
#su
#mount -o remount,rw /system

In a different terminal, push the tun.ko over to the /system/lib/modules dir

adb -d push ~/android-kernel/kernel/drivers/net/tun.ko /system/lib/modules

Back in the first terminal, set the system volume to read only again.

#mount -o remount,ro /system

3. Install the latest get-a-robot-vpnc package

Download from website and push to device:

adb -d install VPN_Connections_v097.apk

It is installed to /data/data/org.codeandroid.vpnc_frontend directory.

I put in the correct settings to connect to my companies vpn. (These same settings work perfectly on my ubuntu machine)

When I run the program I see on logcat:

D/VPN_Connections( 658): Password is numeric
D/VPN_Connections( 658): password **********
D/VPN_Connections( 658): done interacting with vpnc
D/VPN_Connections( 658): process stderr:
D/VPN_Connections( 658):
D/VPN_Connections( 658): Attempt to read vpnc process id did not return anything
D/VPN_Connections( 658): process had died, return as failed connection

But when i shell into the phone I see the process running:

/ # ps | grep vpnc
658 10049 107m S org.codeandroid.vpnc_frontend
710 0 1300 S /data/data/org.codeandroid.vpnc_frontend/files/vpnc -

At this point the network is hosed and in order to get it back I have to reboot.

Trying it manually

In order to see what is happening with vpnc, I shell into the phone and run the program manually.

First I need to ensure the tun.ko is loaded:

#su
#insmod /system/lib/modules/tun.ko

You can see the command string for vpnc in the /data/data/org.codeandroid.vpnc_frontend/files/lastConnection.txt file.

I run this command:

/data/data/org.codeandroid.vpnc_frontend/files/vpnc --script /data/data/org.codeandroid.vpnc_frontend/files/vpnc-script --no-detach --debug 1

Enter the correct vpn data and see this output: (i cut out my company specific info and ip addresses)

vpnc version ERSION
IKE SA selected psk+xauth-3des-md5
NAT status: NAT-T VID seen, no NAT device detected
IKE SA selected psk+xauth-3des-md5
NAT status: NAT-T VID seen, no NAT device detected
Enter Username and Password.
Banner: Welcome <cut> Remote Access User.

got address <xxx.xxx.xxx.xxx>
Connect Banner:
| Welcome <cut> Remote Access User.

backing up dns and resolve.conf
vpnc-script ran to completion
IPSEC SA selected aes128-sha1
VPNC started in foreground...
vpnc[582]: can't open pidfile /var/run/vpnc/pid for writing

At this point I seem to be connected.. but can't actually ping anything on my company network, or get to any websites.

I am not very strong with networking.. so I feel that maybe the routes are not being setup properly.. but I don't know:

Here is my routing table after the connection (took out company ip)

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
68.28.145.85 * 255.255.255.255 UH 0 0 0 ppp0
xxx.xxx.xxx.xx 68.28.145.85 255.255.255.255 UGH 0 0 0 ppp0
default * 0.0.0.0 U 0 0 0 tun0

Any help would be appreciated.