<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Tech Haus &#187; Android</title>
	<atom:link href="http://techha.us/tag/android/feed/" rel="self" type="application/rss+xml" />
	<link>http://techha.us</link>
	<description>House of Tech</description>
	<lastBuildDate>Tue, 28 Sep 2010 14:14:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Android VPN &#8211; VPNC</title>
		<link>http://techha.us/2009/06/android-vpn-vpnc/</link>
		<comments>http://techha.us/2009/06/android-vpn-vpnc/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 16:18:29 +0000</pubDate>
		<dc:creator>pezhore</dc:creator>
				<category><![CDATA[G1]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[VPN]]></category>

		<guid isPermaLink="false">http://techha.us/?p=83</guid>
		<description><![CDATA[I work in the IT department and we&#8217;re just rolling out Cisco VPN (with dongles) to replace our older ISA VPN. Seeing as my G1 is the first &#8220;smart&#8221; phone I&#8217;ve ever owned, I thought I&#8217;d get it setup to VPN in to work (So I could use the Android App Remote RDP). Unfortuantely it [...]]]></description>
			<content:encoded><![CDATA[<p>I work in the IT department and we&#8217;re just rolling out Cisco VPN (with dongles) to replace our older ISA VPN. Seeing as my G1 is the first &#8220;smart&#8221; phone I&#8217;ve ever owned, I thought I&#8217;d get it setup to VPN in to work (So I could use the Android App <a href="http://www.cyrket.com/package/org.toremote.serversmanager">Remote RDP</a>). Unfortuantely it didn&#8217;t appear to be a simple app available to accomplish this feat. About two weeks ago, I stumbled upon <a href="http://ubergeeky.com/blog/110-connect-to-cisco-vpn-from-android">this page</a> which described how to configure vpn for Android. Using those directions (with help from the xda developer&#8217;s forum <a href="http://forum.xda-developers.com/showpost.php?p=3814574&amp;postcount=27">here</a>) I was able to get VPN&#8217;ed into work, and RDP&#8217;ed to my workstation. Here&#8217;s what I did.</p>
<h3>Requirements</h3>
<ul>
<li>A rooted G1 with the tun module available (I used <a href="http://jf.andblogs.net/2009/05/24/jfv151-images-are-out/">JF 1.51</a>)</li>
<li>JF&#8217;s Terminal Emulator (included with JF 1.51)</li>
<li>Remote RDP</li>
<li>Linux knowledge (optional)</li>
</ul>
<h3>Setup</h3>
<ol>
<li>Download the Get-a-Robot VPNC bz2 file from <a href="http://code.google.com/p/get-a-robot-vpnc/downloads/list">google code</a></li>
<li>Extract the archive (if on Linux you can use bunzip2, in Windows 7-zip works well) to a known folder. I extracted to c:\android-vpn\
<ul>
<li> Note: I did the bulk of this on Windows, but if you&#8217;re smart you can translate this to Linux</li>
</ul>
</li>
<li>Open <strong>vpnc.conf</strong> located in <strong>./data/data/org.codeandroid.vpnc/etc/vpnc/</strong></li>
<li>Edit the file with information from your Cisco .pcf file. Below is the mapping of variables for <span style="color: #993300;">vpnc.conf</span> to <strong>YourFile.pcf</strong>.
<ul>
<li><span style="color: #993300;">IPSec gateway</span> = <strong>Host</strong></li>
<li><span style="color: #993300;">IPSec ID</span> =<strong>GroupName</strong></li>
<li><span style="color: #993300;">IPSec secret</span> = <strong>GroupPwd</strong> (or if GroupPwd is blank, you&#8217;ll have to decrypt the <strong>enc_GroupPwd</strong> variable as shown below)</li>
<li><span style="color: #993300;">Xauth username</span> = Your login username</li>
<li><span style="color: #993300;">Xauth password</span><span style="color: #000000;"> </span>= Nothing. Leave this blank to have VPNC prompt you for your password every time.</li>
</ul>
<p>My vpnc.conf file (sanitized and with the wrong username):</p>
<p style="text-align: center;"><img class="alignnone size-full wp-image-87" title="vpnc_config" src="http://techha.us/wp-content/uploads/2009/06/vpnc_config.PNG" alt="vpnc_config" width="397" height="156" /></p>
</li>
<li>Edit the <strong>vpnc-script</strong> and change the first line from <span style="color: #3366ff;"><em>#!/system/bin/bash</em></span> to <span style="color: #3366ff;"><em>#!/system/bin/sh</em></span></li>
<li>Open a command prompt and push the files using <strong>adb push x:\path\to\data /</strong>, copying the edited script and config file to the root of your G1.<strong><img class="aligncenter size-full wp-image-90" title="vpnc_push" src="http://techha.us/wp-content/uploads/2009/06/vpnc_push.PNG" alt="vpnc_push" width="677" height="274" /></strong></li>
<li>Mount the microSDHC card and create a new folder in its root called vpnc.</li>
<li>Create two files: <strong>go</strong> and <strong>prep<br />
</strong>go should contain this one line:<br />
<em><span style="color: #c0c0c0;"><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 --pid-file /data/data/org.codeandroid.vpnc/etc/vpnc/vpnc-pid --no-detach --debug 1</code></span></em><strong> </strong></p>
<p><strong> </strong>prep contains a few lines:<br />
<em><span style="color: #c0c0c0;"><code>modprobe tun<br />
lsmod<br />
mkdir /dev/net<br />
ln -s /dev/tun /dev/net/tun</code></span></em></li>
<li>Unmount the microSDHC card and then fire up terminal emulator &#8211; we need to chmod a few files to make things work.<br />
<em><span style="color: #c0c0c0;"><code>chmod 777 /data/data/org.codeandroid.vpnc/bin/vpnc<br />
chmod 777 /data/data/org.codeandroid.vpnc/etc/vpnc/vpnc-script</code></span></em></li>
</ol>
<h3>Starting the VPN</h3>
<ol>
<li>In Terminal Emulator type <strong>su</strong> to get root access (Approve if it prompts you to grant permission)</li>
<li>As root (designated by the &#8220;#&#8221; prompt) run <strong>cd /sdrom/vpnc</strong></li>
<li>Run <strong>sh prep</strong> (Note: this is only required once each time you reboot your phone)</li>
<li>To start the VPN, run <strong>sh go</strong>. It will prompt your for your password, then attempt to connect:<br />

<div class="ngg-galleryoverview" id="ngg-gallery-2-83">

	<!-- Slideshow link -->
	<div class="slideshowlink">
		<a class="slideshowlink" href="http://techha.us/2009/06/android-vpn-vpnc/?show=slide">
			[Show as slideshow]		</a>
	</div>

	<!-- Piclense link -->
	<div class="piclenselink">
		<a class="piclenselink" href="javascript:PicLensLite.start({feedUrl:'http://techha.us/wp-content/plugins/nextgen-gallery/xml/media-rss.php?gid=2&amp;mode=gallery'});">
			[View with PicLens]		</a>
	</div>
	
	<!-- Thumbnails -->
		
	<div id="ngg-image-12" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://techha.us/wp-content/gallery/vpnc/vpnc_prep.png" title=" " class="shutterset_set_2" >
								<img title="vpnc_prep" alt="vpnc_prep" src="http://techha.us/wp-content/gallery/vpnc/thumbs/thumbs_vpnc_prep.png" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-11" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://techha.us/wp-content/gallery/vpnc/vpnc_login.png" title=" " class="shutterset_set_2" >
								<img title="vpnc_login" alt="vpnc_login" src="http://techha.us/wp-content/gallery/vpnc/thumbs/thumbs_vpnc_login.png" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-14" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://techha.us/wp-content/gallery/vpnc/vpnc_setup.png" title=" " class="shutterset_set_2" >
								<img title="vpnc_setup" alt="vpnc_setup" src="http://techha.us/wp-content/gallery/vpnc/thumbs/thumbs_vpnc_setup.png" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-10" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://techha.us/wp-content/gallery/vpnc/vpnc_connected.png" title=" " class="shutterset_set_2" >
								<img title="vpnc_connected" alt="vpnc_connected" src="http://techha.us/wp-content/gallery/vpnc/thumbs/thumbs_vpnc_connected.png" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 	 	
	<!-- Pagination -->
 	<div class='ngg-clear'></div>
 	
</div>

</li>
<li>You can then click the back button to leave the vpn connection running and fire up Remote<br />
<img class="aligncenter size-full wp-image-99" title="vpnc_remote" src="http://techha.us/wp-content/uploads/2009/06/vpnc_remote.png" alt="vpnc_remote" width="480" height="320" /></li>
<li>To close the VPN, reopen Terminal Emulator, and if it&#8217;s still up and running, send the interrupt (ctrl-c) by clicking and holding the mouse ball, then pressing &#8216;c&#8217;</li>
<li>If the vpn is not still running, you can find the process ID number by running <strong>ps</strong> and looking for <strong>/data/data/org/codeandroid.vpnc/bin/vpnc</strong>.<br />
<img class="aligncenter size-full wp-image-109" title="vpnc_kill" src="http://techha.us/wp-content/uploads/2009/06/vpnc_kill1.png" alt="vpnc_kill" width="480" height="320" /></li>
<li>Kill the process by running <strong>kill -9 [pid]</strong>, (in our example <strong>kill -9 1896</strong>)</li>
</ol>
<h3>Final Thoughts</h3>
<p>Although this isn&#8217;t ideal for an extended VPN connection, if combinded with tethering (something I&#8217;m working on next), it could become quite powerful. For quick checks, this works quite well.</p>
<p>Sources:<br />
<a href="http://forum.xda-developers.com/showpost.php?p=3814574&amp;postcount=27">xda-developer&#8217;s forum</a><br />
<a href="http://ubergeeky.com/blog/110-connect-to-cisco-vpn-from-android">Uber Geeky post</a><br />
<a href="http://code.google.com/p/get-a-robot-vpnc/">Get-A-Robot-VPNC Google Code Page</a></p>
]]></content:encoded>
			<wfw:commentRss>http://techha.us/2009/06/android-vpn-vpnc/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

