<?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>unixwiz &#187; OpenVPN</title>
	<atom:link href="http://blogs.sungeek.net/unixwiz/tag/openvpn/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.sungeek.net/unixwiz</link>
	<description>anything dealing with *NIX or what ever I want to write about</description>
	<lastBuildDate>Wed, 04 Aug 2010 03:04:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>OpenVPN between Solaris and MacOSX</title>
		<link>http://blogs.sungeek.net/unixwiz/2009/08/18/openvpn-between-solaris-and-macosx/</link>
		<comments>http://blogs.sungeek.net/unixwiz/2009/08/18/openvpn-between-solaris-and-macosx/#comments</comments>
		<pubDate>Wed, 19 Aug 2009 00:06:34 +0000</pubDate>
		<dc:creator>unixwiz</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[VPN]]></category>
		<category><![CDATA[LZO]]></category>
		<category><![CDATA[MacOSX]]></category>
		<category><![CDATA[OpenVPN]]></category>
		<category><![CDATA[TUN]]></category>
		<category><![CDATA[Tunnelblick]]></category>

		<guid isPermaLink="false">http://blogs.sungeek.net/unixwiz/?p=1178</guid>
		<description><![CDATA[I decided to see if I could get a VPN connection working between my laptop (running MacOSX) and my home server running Solaris 10. It turned out to be pretty easy to do a simple config. I am using OpenVPN. To compile the software on my Solaris box I needed to download 3 items: Virtual [...]]]></description>
			<content:encoded><![CDATA[<p>I decided to see if I could get a VPN connection working between my laptop (running MacOSX) and my home server running Solaris 10. It turned out to be pretty easy to do a simple config. I am using <a href="http://openvpn.net/">OpenVPN</a>. To compile the software on my Solaris box I needed to download 3 items:</p>
<ol>
<li>
 Virtual Point-to-Point (Tun) and Ethernet (TAP) devices driver. I got the version 1.1 from <a href="http://vtun.sourceforge.net/tun/">http://vtun.sourceforge.net/tun/</a> in source code form.</li>
<li>LZO version 1.08 compression software from : <a href="http://www.oberhumer.com/opensource/lzo/download/LZO-v1/">http://www.oberhumer.com/opensource/lzo/download/LZO-v1/</a>
</li>
<li>OpenVPN software, I am using the version 2.1RC because I wanted the version to match what I am going to run on the Mac. It can be downloaded from <a href="http://openvpn.net/index.php/open-source/downloads.html">http://openvpn.net/index.php/open-source/downloads.html</a>
</li>
</ol>
<p>Once I got everything downloaded, just compile the LZO, Tun, and OpenVPN:<br />
I decided to have everything related to the vpn installed in /opt/vpn. One thing to note, I tried using the new version 2.x of LZO, and OpenVPN would not find it, so I had to use Version 1 even though 2 is supposed to be supported. So I did the following to compile LZO:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="kw2">gzip</span> -d lzo<span class="nu0">-1.08</span>.<span class="kw2">tar</span>.gz<br />
<span class="kw2">tar</span> -xvf lzo<span class="nu0">-1.08</span>.<span class="kw2">tar</span><br />
<span class="kw3">cd</span> lzo<span class="nu0">-1.08</span><br />
./configure &#8211;<span class="re2">prefix=</span>/opt/vpn/lzo<br />
<span class="kw2">make</span><br />
<span class="kw2">sudo</span> <span class="kw2">make</span> <span class="kw2">install</span></div>
</div>
<p>Next was to compile TUN</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="kw2">gzip</span> -d tun<span class="nu0">-1.1</span>.<span class="kw2">tar</span><br />
<span class="kw2">tar</span> -xvf tun<span class="nu0">-1.1</span>.<span class="kw2">tar</span><br />
<span class="kw3">cd</span> tun<span class="nu0">-1.1</span><br />
./configure &#8211;<span class="re2">prefix=</span>/opt/vpn/tun<br />
<span class="kw2">make</span><br />
<span class="kw2">sudo</span> <span class="kw2">make</span> <span class="kw2">install</span></div>
</div>
<p>Only issue with tun was that it did not use the &#8211;prefix, it puts everything where it needs to be in /usr/kernel/drv on solaris.</p>
<p>Next is openvpn:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="kw2">gzip</span> -d openvpn<span class="nu0">-2</span>.1_rc19.<span class="kw2">tar</span>.gz<br />
<span class="kw2">tar</span> -xvf openvpn<span class="nu0">-2</span>.1_rc19.<span class="kw2">tar</span><br />
<span class="kw3">cd</span> openvpn<span class="nu0">-2</span>.1_rc19<br />
./configure &#8211;<span class="re2">prefix=</span>/opt/vpn/openvpn &#8211;with-lzo-<span class="re2">headers=</span>/opt/vpn/lzo/include &#8211;with-lzo-<span class="re2">lib=</span>/opt/vpn/lzo/lib<br />
<span class="kw2">make</span><br />
<span class="kw2">sudo</span> <span class="kw2">make</span> <span class="kw2">install</span></div>
</div>
<p>Once that is installed I did the simple 1 to 1 vpn connection (static key) for just testing to see if it would work. So in the /opt/vpn/openvpn/sbin directory I did this:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="kw3">cd</span> /opt/vpn/openvpn/sbin<br />
./openvpn &#8211;genkey &#8211;secret static.key</div>
</div>
<p>I then copy that key to my client via some &#8220;secure&#8221; means</p>
<p>Then created a server.conf that looks like this:</p>
<pre>
dev tun
ifconfig 10.8.0.1 10.8.0.2
secret static.key
cipher AES-256-CBC
keepalive 10 120
</pre>
<p>On my client (MacOSX) I downloaded Tunnelblick from <a href="http://code.google.com/p/tunnelblick/downloads/list">http://code.google.com/p/tunnelblick/downloads/list</a> and installed it. Next I copied that static.key from the server to the client and put it in ~/Library/openvpn. I also created a openvpn.conf in that directory that looked like this:</p>
<pre>
remote a.b.c.d
dev tun
ifconfig 10.8.0.2 10.8.0.1
secret static.key
cipher AES-256-CBC
route 10.0.0.0 255.255.255.0
</pre>
<p>In the above, a.b.c.d represents my public IP address for my solaris server.</p>
<p>Now when you start tunnelblick it will search that directory and find that config file and ask if you want to load it. But we are not quite ready to start yet. The next thing I had to do was forward port 1194 UDP off of my router to my OpenVPN server. I will leave this exercise to you. You will also need to make sure IP forwarding is enabled on the Solaris 10 server (because I only have 1 network card in it, but &#8220;two&#8221; different networks on the box. IP Forwarding will allow your remote machine to be able to see your local network. And since my OpenVPN server is not the router for the entire network, I had to add a static route on my router to say that 10.8.0.0 is available via the openvpn servers local network address, I.e. 10.0.0.1. </p>
<p>You should be able to start the openvpn server now:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">/opt/vpn/openvpn/sbin/openvpn server.conf</div>
</div>
<p>Once it is started you can use tunnelblick to connect. Once you are connected, you should see that is is connected and the icon has changed from this:<br />
<a href="http://blogs.sungeek.net/unixwiz/wp-content/uploads/2009/08/Picture-3.png"><img src="http://blogs.sungeek.net/unixwiz/wp-content/uploads/2009/08/Picture-3.png" alt="Picture 3" title="Picture 3" width="26" height="23" class="alignnone size-full wp-image-1180" /></a><br />
to look like this:<br />
<a href="http://blogs.sungeek.net/unixwiz/wp-content/uploads/2009/08/Picture-2.png"><img src="http://blogs.sungeek.net/unixwiz/wp-content/uploads/2009/08/Picture-2.png" alt="Picture 2" title="Picture 2" width="40" height="20" class="alignnone size-full wp-image-1179" /></a></p>
<p>You should also see a tun0 device show up:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">ifconfig tun0<br />
tun0: <span class="re2">flags=</span><span class="nu0">8851</span> &lt; up ,POINTOPOINT,RUNNING,SIMPLEX,MULTICAST &gt; mtu <span class="nu0">1500</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; inet <span class="nu0">10.8</span><span class="nu0">.0</span><span class="nu0">.2</span> &#8211;&gt; <span class="nu0">10.8</span><span class="nu0">.0</span><span class="nu0">.1</span> netmask 0xffffffff <br />
&nbsp; &nbsp; &nbsp; &nbsp; open <span class="br0">&#40;</span>pid <span class="nu0">608</span><span class="br0">&#41;</span></div>
</div>
<p>You should now be able to see all your hosts on the &#8220;remote&#8221; network. Next up I am going to work on doing the pki infrastructure so I can hopefully link other clients both static and dynamic.</p>
<p>This make is really nice to be able to see your &#8220;home&#8221; network while you are away. </p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.sungeek.net/unixwiz/2009/08/18/openvpn-between-solaris-and-macosx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
