<?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>A Million Monkeys &#187; vpn</title>
	<atom:link href="http://www.monkeedev.co.uk/blog/tag/vpn/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.monkeedev.co.uk/blog</link>
	<description>Surviving life as a sysadmin.</description>
	<lastBuildDate>Tue, 22 Jun 2010 15:48:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Setting up OpenVPN in debian/ubuntu</title>
		<link>http://www.monkeedev.co.uk/blog/2009/03/06/setting-up-openvpn-in-debianubuntu/</link>
		<comments>http://www.monkeedev.co.uk/blog/2009/03/06/setting-up-openvpn-in-debianubuntu/#comments</comments>
		<pubDate>Fri, 06 Mar 2009 09:18:01 +0000</pubDate>
		<dc:creator>Kris</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[openvpn]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[vpn]]></category>

		<guid isPermaLink="false">http://www.monkeedev.co.uk/blog/?p=22</guid>
		<description><![CDATA[This is little bit later than I originally intended but I finally got around to setting up OpenVPN, and here&#8217;s how I did it. This guide is pretty simple to follow and should have an OpenVPN server on debian or ubuntu working within half an hour. I&#8217;ll also explain how to connect to the VPN [...]]]></description>
			<content:encoded><![CDATA[<p>This is little bit later than I originally intended but I finally got around to setting up OpenVPN, and here&#8217;s how I did it.</p>
<p>This guide is pretty simple to follow and should have an OpenVPN server on debian or ubuntu working within half an hour. I&#8217;ll also explain how to connect to the VPN from a windows PC.</p>
<p>First, install OpenVPN on the server (you&#8217;ll need to be root for all of this guide)</p>
<blockquote><p>apt-get install openvpn</p></blockquote>
<p>Next, we need to configure the server. You need to make a decision here whether you want tun (routed) or tap (bridged) connections. The main difference is that tap will give the client a network address on the server network, whereas tun creates a private network managed by the server. In this guide I will use tap because I find that it works better with windows clients.</p>
<p>Now you need to create certificates for the server and client for authentication purposes (which is much more secure than the passwords used in pptp). This is done through a number of steps:</p>
<p>Preparing to generate the keys</p>
<blockquote><p>mkdir /etc/openvpn/easy-rsa<br />
cp /usr/share/doc/openvpn/examples/easy-rsa/2.0/* /etc/openvpn/easy-rsa</p></blockquote>
<p>Now you need to edit /etc/openvpn/easy-rsa/vars with your required settings. You only really need to change the last section which is the default values for the fields in the certificates.</p>
<p>Generate the certificate authority (CA) which will be used to sign the server and client certificates.</p>
<blockquote><p>cd /etc/openvpn/easy-rsa<br />
source ./vars<br />
./clean-all<br />
./build-ca</p></blockquote>
<p>Next, we need to create the server keys</p>
<blockquote><p>./build-key-server servername</p></blockquote>
<p>Answer &#8216;yes&#8217; when asked to sign the certificate and commit to the database, and then you&#8217;ll need to generate the diffie-hellman parameters which are used for key exchange between the client and server.</p>
<blockquote><p>./build-dh</p></blockquote>
<p>And finally, create some client keys which will be used to allow clients to authenticate with the server. I prefer to use pkcs12 which stores the client public key and certificate in one passworded file.</p>
<blockquote><p>./build-key-pkcs12 client1</p></blockquote>
<p>As before, sign the key and commit to the database. You will be asked for a password which the client will use to connect to the server.</p>
<p>Now all the keys are created, we need to configure the server.</p>
<blockquote><p>vim /etc/openvpn/server.conf<br />
(add the following lines)<br />
port 443<br />
proto tcp<br />
dev tap<br />
ca /etc/openvpn/easy-rsa/keys/ca.crt<br />
cert /etc/openvpn/easy-rsa/keys/servername.crt<br />
key /etc/openvpn/easy-rsa/keys/servername.key<br />
dh /etc/openvpn/easy-rsa/keys/dh1024.pem<br />
ifconfig-pool-persist ipp.txt<br />
server-bridge 10.1.0.1 255.255.255.0 10.1.0.236 10.1.0.245<br />
push &#8220;route 10.0.0.0 255.0.0.0&#8243;<br />
keepalive 10 120<br />
comp-lzo<br />
persist-key<br />
persist-tun<br />
status /var/log/openvpn-status.log<br />
verb 3</p></blockquote>
<p>The only lines which you will need to change are &#8216;server-bridge&#8217;, which is simply the default gateway, subnet mask, and the start and end IP&#8217;s to assign the clients, and the push route, which pushes specific routes to all clients.</p>
<p>Now we need to create an ethernet bridge. First, we need to install bridge-utils:</p>
<blockquote><p>apt-get install bridge-utils</p></blockquote>
<p>Rather than explain how to set up a network bridge, I found a shell script which will do it for you. This can be found <a title="Ethernet Bridge" href="http://www.monkeedev.co.uk/blog/wp-content/uploads/2009/openvpn/bridge.txt">here</a>. Just edit this with your network settings and execute it. You will also need to set it to create the bridge at boot time:</p>
<blockquote><p>update-rc.d bridge defaults</p></blockquote>
<p>Now you can start the openvpn server</p>
<blockquote><p>/etc/init.d/openvpn start</p></blockquote>
<p>Now we need to set up the windows client. First, download the OpenVPN client from <a href="http://openvpn.net/index.php/downloads.html">here</a> (at the time of writing, select 2.1 RC15). Install it, and create a file &#8216;client.conf&#8217; in the config directory with the following parameters</p>
<blockquote><p>client<br />
dev tap<br />
proto tcp<br />
remote x.x.x.x 443 # (replace with your server IP)<br />
resolv-retry infinite<br />
nobind<br />
pkcs12 client1.p12 # (replace with the client name)<br />
ns-cert-type server<br />
comp-lzo<br />
verb 3</p></blockquote>
<p>You can also add &#8216;redirect-gateway&#8217; to the client configuration to pass all traffic down the VPN tunnel (rather than just traffic intended for the VPN itself).</p>
<p>Now copy the client1.p12 certificate file to the config directory on the client, start the gui, and connect. Everything should now work.</p>
<p>If you need to create any clients in the future, do the following:</p>
<blockquote><p>cd /etc/openvpn/easy-rsa<br />
source ./vars<br />
./build-key-pkcs12 clientx</p></blockquote>
<p>If one of your certificates is compromised, you can revoke it using the guide <a href="http://openvpn.net/index.php/documentation/howto.html#revoke">here</a>.</p>
<p>This guide has been written from my notes and what I remember, so there may be a couple of things which aren&#8217;t 100% right. If anything goes wrong then post a comment or contact me and I&#8217;ll update the guide.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.monkeedev.co.uk%2Fblog%2F2009%2F03%2F06%2Fsetting-up-openvpn-in-debianubuntu%2F&amp;title=Setting+up+OpenVPN+in+debian%2Fubuntu" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.monkeedev.co.uk/blog/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.monkeedev.co.uk%2Fblog%2F2009%2F03%2F06%2Fsetting-up-openvpn-in-debianubuntu%2F&amp;title=Setting+up+OpenVPN+in+debian%2Fubuntu" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.monkeedev.co.uk/blog/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.monkeedev.co.uk%2Fblog%2F2009%2F03%2F06%2Fsetting-up-openvpn-in-debianubuntu%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.monkeedev.co.uk/blog/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.monkeedev.co.uk%2Fblog%2F2009%2F03%2F06%2Fsetting-up-openvpn-in-debianubuntu%2F&amp;title=Setting+up+OpenVPN+in+debian%2Fubuntu" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.monkeedev.co.uk/blog/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.monkeedev.co.uk%2Fblog%2F2009%2F03%2F06%2Fsetting-up-openvpn-in-debianubuntu%2F&amp;title=Setting+up+OpenVPN+in+debian%2Fubuntu" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.monkeedev.co.uk/blog/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.monkeedev.co.uk%2Fblog%2F2009%2F03%2F06%2Fsetting-up-openvpn-in-debianubuntu%2F&amp;title=Setting+up+OpenVPN+in+debian%2Fubuntu" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.monkeedev.co.uk/blog/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.monkeedev.co.uk%2Fblog%2F2009%2F03%2F06%2Fsetting-up-openvpn-in-debianubuntu%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.monkeedev.co.uk/blog/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Setting+up+OpenVPN+in+debian%2Fubuntu+@+http%3A%2F%2Fwww.monkeedev.co.uk%2Fblog%2F2009%2F03%2F06%2Fsetting-up-openvpn-in-debianubuntu%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.monkeedev.co.uk/blog/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.monkeedev.co.uk/blog/2009/03/06/setting-up-openvpn-in-debianubuntu/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>Setting up a debian PPTP VPN</title>
		<link>http://www.monkeedev.co.uk/blog/2007/08/10/setting-up-a-debian-pptp-vpn/</link>
		<comments>http://www.monkeedev.co.uk/blog/2007/08/10/setting-up-a-debian-pptp-vpn/#comments</comments>
		<pubDate>Fri, 10 Aug 2007 21:36:50 +0000</pubDate>
		<dc:creator>Kris</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[pptp]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[vpn]]></category>

		<guid isPermaLink="false">http://www.monkeedev.co.uk/blog/2007/08/10/setting-up-a-debian-pptp-vpn/</guid>
		<description><![CDATA[This article follows on from my hamachi based VPN tutorial. PPTP is much easier to set up on a debian server, and very easy to connect to from a Windows XP machine. With the ease of use though, there are some downfalls. PPTP is known to be less secure than other VPN&#8217;s such as OpenVPN [...]]]></description>
			<content:encoded><![CDATA[<p>This article follows on from my <a href="http://www.monkeedev.co.uk/blog/2007/06/22/setting-up-a-hamachi-vpn/">hamachi based VPN</a> tutorial. PPTP is much easier to set up on a debian server, and very easy to connect to from a Windows XP machine.</p>
<p>With the ease of use though, there are some downfalls. PPTP is known to be less secure than other VPN&#8217;s such as OpenVPN and IPSEC, but for most uses it should be fine. One advantage over my hamachi VPN is that you will end up with an IP on the remote LAN (instead of the 5.0.0.0/8 address you have from hamachi), meaning you don&#8217;t need to do any routing tweaks.</p>
<p>First, set up the server:</p>
<blockquote><p><em>apt-get install pptpd</em></p></blockquote>
<p>That&#8217;s it! Now, to configure, you just need to edit 2 files:</p>
<blockquote><p>/etc/pptpd.conf<br />
Just add 2 lines to the bottom of the file, for the internal IP address of the server, and a range of IP&#8217;s which the remote connections will use.<br />
<em>localip 10.1.0.50<br />
remoteip 10.1.0.90-99</em></p></blockquote>
<p>The comments at the bottom of the file show some other ways of assigning ranges of IP&#8217;s in the remoteip section.</p>
<p>Finally, to add a user, edit /etc/ppp/chap-secrets and add a line for a remote user in the format:</p>
<blockquote><p>username pptpd password *</p></blockquote>
<p>To limit connections from specific hosts, use them instead of the * at the end.</p>
<p>To set up the connection on a windows XP client, do the following (from Control Panel):</p>
<blockquote><p> <em>Network Connections</em><br />
Create a New Connection<br />
Next<br />
Connect to the network at my workplace<br />
Virtual Private Network connection<br />
Enter your connection name<br />
Do not dial the initial connection<br />
Enter the IP of your server</p></blockquote>
<p>Then run the connection with the username and password you entered into /etc/ppp/chap-secrets</p>
<p>By default this will route all your traffic (including normal web browsing) through the tunnel. If you don&#8217;t want this, go to the connection properties, then the networking tab. Choose TCP/IP properties, and click &#8216;Advanced&#8217;, then finally untick the &#8216;Use default gateway on remote network&#8217; tickbox.</p>
<p>That should be all you need.</p>
<p>Soon, I&#8217;ll give OpenVPN a try, and try to write up a nice guide here.</p>
<p>Most of the information above came from other sites, and by googling. If anyone knows of a better or more secure way of using PPTP then please post comments below.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.monkeedev.co.uk%2Fblog%2F2007%2F08%2F10%2Fsetting-up-a-debian-pptp-vpn%2F&amp;title=Setting+up+a+debian+PPTP+VPN" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.monkeedev.co.uk/blog/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.monkeedev.co.uk%2Fblog%2F2007%2F08%2F10%2Fsetting-up-a-debian-pptp-vpn%2F&amp;title=Setting+up+a+debian+PPTP+VPN" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.monkeedev.co.uk/blog/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.monkeedev.co.uk%2Fblog%2F2007%2F08%2F10%2Fsetting-up-a-debian-pptp-vpn%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.monkeedev.co.uk/blog/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.monkeedev.co.uk%2Fblog%2F2007%2F08%2F10%2Fsetting-up-a-debian-pptp-vpn%2F&amp;title=Setting+up+a+debian+PPTP+VPN" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.monkeedev.co.uk/blog/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.monkeedev.co.uk%2Fblog%2F2007%2F08%2F10%2Fsetting-up-a-debian-pptp-vpn%2F&amp;title=Setting+up+a+debian+PPTP+VPN" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.monkeedev.co.uk/blog/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.monkeedev.co.uk%2Fblog%2F2007%2F08%2F10%2Fsetting-up-a-debian-pptp-vpn%2F&amp;title=Setting+up+a+debian+PPTP+VPN" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.monkeedev.co.uk/blog/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.monkeedev.co.uk%2Fblog%2F2007%2F08%2F10%2Fsetting-up-a-debian-pptp-vpn%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.monkeedev.co.uk/blog/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Setting+up+a+debian+PPTP+VPN+@+http%3A%2F%2Fwww.monkeedev.co.uk%2Fblog%2F2007%2F08%2F10%2Fsetting-up-a-debian-pptp-vpn%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.monkeedev.co.uk/blog/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.monkeedev.co.uk/blog/2007/08/10/setting-up-a-debian-pptp-vpn/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Setting up a hamachi VPN</title>
		<link>http://www.monkeedev.co.uk/blog/2007/06/22/setting-up-a-hamachi-vpn/</link>
		<comments>http://www.monkeedev.co.uk/blog/2007/06/22/setting-up-a-hamachi-vpn/#comments</comments>
		<pubDate>Fri, 22 Jun 2007 08:07:03 +0000</pubDate>
		<dc:creator>Kris</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[hamachi]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[vpn]]></category>

		<guid isPermaLink="false">http://www.monkeedev.co.uk/blog/2007/06/22/setting-up-a-hamachi-vpn/</guid>
		<description><![CDATA[I&#8217;ve had a pretty stable VPN setup on my networks for some time now, and I thought others might like a guide on how to get everything working. I had trouble following the threads explaining the concepts, so I spent some time getting it all working myself. This can all be done using the free [...]]]></description>
			<content:encoded><![CDATA[<p><font class="postbody">I&#8217;ve had a pretty stable VPN setup on my networks for some time now, and I thought others might like a guide on how to get everything working. I had trouble following the threads explaining the concepts, so I spent some time getting it all working myself.</font></p>
<p><font class="postbody">This can all be done using the free hamachi version. I have a premium license so I can make the network more secure by having to authorise new members.</font></p>
<p><font class="postbody">This guide covers connecting a windows XP machine to private networks with linux and windows machines acting as the routing nodes.</font></p>
<p><font class="postbody">I have 2 networks in my office, 10.1.0.0 and 10.2.0.0. I use the VPN for connecting my laptop to these networks from home.</font></p>
<p><font class="postbody"><font style="font-weight: bold">Setting up the &#8216;client&#8217; XP machine (the one which needs to VPN into the networks)</font><br />
- Download and install hamachi<br />
- Create a new network specifically for the VPN.<br />
- Add &#8216;RoutedTunneling 1&#8242; to hamachi-override.ini and restart Hamachi. You may need to create this file by clicking Configure, Preferences, System, Open Configuration Folder &#8211; then create hamachi-override.ini<br />
- Click Start, Run and type &#8216;regedit&#8217;, then set HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTcpipParametersIPEnableRouter to 1<br />
- Reboot and open hamachi.</font></p>
<p><font class="postbody"><font style="font-weight: bold">First &#8216;server&#8217; &#8211; Windows (10.1.0.53 is the example local IP)</font><br />
Follow the instructions above, but instead of creating a new network, join the one you previously created. That&#8217;s all you need to do to get a windows server set up.</font></p>
<p><font class="postbody"><font style="font-weight: bold">Linux &#8216;servers&#8217; (10.2.0.201 on my local network)</font><br />
- cd /opt<br />
- wget <a href="http://files.hamachi.cc/linux/hamachi-0.9.9.9-20-lnx.tar.gz" target="_blank">http://files.hamachi.cc/linux/hamachi-0.9.9.9-20-lnx.tar.gz</a><br />
- tar -zxvf hamachi-0.9.9.9-20-lnx.tar.gz<br />
- cd hamachi-0.9.9.9-20-lnx/<br />
- mkdir /dev/net<br />
- make install<br />
- tuncfg/tuncfg<br />
- hamachi-init<br />
- hamachi start<br />
- hamachi set-nick servername<br />
- hamachi login<br />
- hamachi join networkname networkpassword<br />
- hamachi go-online networkname<br />
- echo 1 &gt; /proc/sys/net/ipv4/ip_forward</font></p>
<p><font class="postbody">Note that whenever the linux machines are rebooted, /proc/sys/net/ipv4/ip_forward will reset to 0.</font></p>
<p><font class="postbody">The server nodes are now setup to forward IPv4 packets around the network.</font></p>
<p><font class="postbody">This next step is where most problems will occur. The server nodes will forward packets to the network, but other machines on the local networks don&#8217;t know where to send data to 5.x.x.x addresses. I set up rules on our firewall which work something like:<br />
Requests to 5.0.0.0/8 need to be routed to 10.1.0.53 on the 10.1 network<br />
Requests to 5.0.0.0/8 need to be routed to 10.2.0.201 on the 10.2 network<br />
This is one rule for each of the networks I need to access. I&#8217;m not sure how to do this in different firewall setups so I&#8217;m not much help here.</font></p>
<p><font class="postbody">Everything is now setup, but the &#8216;client&#8217; node doesnt know where to send packets to any of the 10.1 or 10.2 networks. To fix this, we need to create routes on the machine. I created 2 batch files, one to connect the VPN, and one to disconnect.</font></p>
<p><font class="postbody"><font style="font-weight: bold">Connect batch file</font></font></p>
<table align="center" border="0" cellpadding="3" cellspacing="1" width="90%">
<tr>
<td><font class="genmed"><strong><br />
</strong></font></td>
</tr>
<tr>
<td class="code">@title Connecting Hamachi VPN Tunnels<br />
@echo Connecting Hamachi VPN Tunnels<br />
@echo -connecting to 10.1.0.0 network&#8230;<br />
@route add 10.1.0.0 mask 255.255.255.0 [HAMACHI ADDRESS OF MACHINE ON 10.1]<br />
@echo -connecting to 10.2.0.0 network&#8230;<br />
@route add 10.2.0.0 mask 255.255.255.0 [HAMACHI ADDRESS OF MACHINE ON 10.2]<br />
@echo .<br />
@echo VPN Connected.<br />
@echo To disconnect, run the disable batch file or reboot the system.<br />
@echo .<br />
@pause</td>
</tr>
</table>
<p><font class="postbody"><br />
Obviously you&#8217;ll need to put the hamachi IP&#8217;s of each of the server nodes in this file.</font></p>
<p><font class="postbody"><font style="font-weight: bold">Disconnect batch file</font></font></p>
<table align="center" border="0" cellpadding="3" cellspacing="1" width="90%">
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td class="code">@title Disable Hamachi VPN Tunnels<br />
@echo Disconnecting Hamachi VPN Tunnels<br />
@echo -disconnecting 10.1.0.0<br />
@route delete 10.1.0.0<br />
@echo -disconnecting 10.2.0.0<br />
@route delete 10.2.0.0<br />
@echo .<br />
@echo VPN Disconnected<br />
@echo .<br />
@pause</td>
</tr>
</table>
<p><font class="postbody">At this point everything is set up and ready to connect. You will need full connectivity to all the server nodes which you are using (green icons in hamachi).</font></p>
<p><font class="postbody">Then you run the batch file to connect the VPN (or just type the route commands into a command prompt manually). Test pinging the local address of the server nodes, then other addresses inside the remote network.</font></p>
<p><font class="postbody"><font style="font-weight: bold">Diagnostics</font><br />
First, try pinging the local address of one of the server nodes (10.1.0.53 in my example). If this doesnt work, then my guess is that the route command hasn&#8217;t been done correctly.<br />
Next, try pinging another machine on the local network (10.1.0.50 for example). If this doesnt work, then it&#8217;s likely that the server node isn&#8217;t forwarding the packets correctly, or the responses from the machine you&#8217;re pinging aren&#8217;t being sent back to the server node properly &#8211; check the firewall routing and make sure you&#8217;ve set /proc/sys/net/ipv4/ip_forward to 1.</font></p>
<p><font class="postbody">Note that this whole setup will only work if the client node is actually off of the local network at the time you try to connect. By this, I mean that when I am at work, my laptop has the IP 10.1.0.56 and it connects out via 10.1.0.1 &#8211; obviously the VPN wont work while I&#8217;m at work because the route command will override the default gateway route and stop me connecting out at all. </font></p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.monkeedev.co.uk%2Fblog%2F2007%2F06%2F22%2Fsetting-up-a-hamachi-vpn%2F&amp;title=Setting+up+a+hamachi+VPN" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.monkeedev.co.uk/blog/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.monkeedev.co.uk%2Fblog%2F2007%2F06%2F22%2Fsetting-up-a-hamachi-vpn%2F&amp;title=Setting+up+a+hamachi+VPN" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.monkeedev.co.uk/blog/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.monkeedev.co.uk%2Fblog%2F2007%2F06%2F22%2Fsetting-up-a-hamachi-vpn%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.monkeedev.co.uk/blog/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.monkeedev.co.uk%2Fblog%2F2007%2F06%2F22%2Fsetting-up-a-hamachi-vpn%2F&amp;title=Setting+up+a+hamachi+VPN" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.monkeedev.co.uk/blog/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.monkeedev.co.uk%2Fblog%2F2007%2F06%2F22%2Fsetting-up-a-hamachi-vpn%2F&amp;title=Setting+up+a+hamachi+VPN" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.monkeedev.co.uk/blog/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.monkeedev.co.uk%2Fblog%2F2007%2F06%2F22%2Fsetting-up-a-hamachi-vpn%2F&amp;title=Setting+up+a+hamachi+VPN" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.monkeedev.co.uk/blog/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.monkeedev.co.uk%2Fblog%2F2007%2F06%2F22%2Fsetting-up-a-hamachi-vpn%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.monkeedev.co.uk/blog/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Setting+up+a+hamachi+VPN+@+http%3A%2F%2Fwww.monkeedev.co.uk%2Fblog%2F2007%2F06%2F22%2Fsetting-up-a-hamachi-vpn%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.monkeedev.co.uk/blog/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.monkeedev.co.uk/blog/2007/06/22/setting-up-a-hamachi-vpn/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
