<?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>ramblings of the village idiot &#187; VPN</title>
	<atom:link href="http://www.natecarlson.com/category/vpn/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.natecarlson.com</link>
	<description>All geek, most of the time</description>
	<lastBuildDate>Sat, 03 Jul 2010 19:00:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Configuring an IPsec tunnel between Openswan and Windows 2000/XP with x509</title>
		<link>http://www.natecarlson.com/2007/07/30/configuring-an-ipsec-tunnel-between-openswan-and-windows-2000-xp/</link>
		<comments>http://www.natecarlson.com/2007/07/30/configuring-an-ipsec-tunnel-between-openswan-and-windows-2000-xp/#comments</comments>
		<pubDate>Mon, 30 Jul 2007 20:39:23 +0000</pubDate>
		<dc:creator>nc</dc:creator>
				<category><![CDATA[VPN]]></category>
		<category><![CDATA[IPsec]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[X.509]]></category>

		<guid isPermaLink="false">http://www.natecarlson.com/?p=303</guid>
		<description><![CDATA[This document describes how to get Openswan working with various other IPSec stacks, including Openswan and Windows 2000/XP. If you have any difficulties with this process, please e-mail the Openswan mailing list, or if you can&#8217;t get help from there, e-mail me at: ipsec@natecarlson.com. If you are using clients which benefit from receiving an IP [...]


Related posts:<ol><li><a href='http://www.natecarlson.com/2006/07/10/configuring-an-ipsec-tunnel-with-openswan-and-l2tpd/' rel='bookmark' title='Permanent Link: Configuring an IPsec tunnel with Openswan and l2tpd'>Configuring an IPsec tunnel with Openswan and l2tpd</a></li>
<li><a href='http://www.natecarlson.com/2005/11/22/apologies-to-people-asking-me-for-help-with-ipsec/' rel='bookmark' title='Permanent Link: apologies to people asking me for help with ipsec'>apologies to people asking me for help with ipsec</a></li>
<li><a href='http://www.natecarlson.com/2005/09/16/openswan-240-released/' rel='bookmark' title='Permanent Link: openswan 2.4.0 released'>openswan 2.4.0 released</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p></p><p>This document describes how to get <a href="http://www.openswan.org">Openswan</a> working with various other IPSec stacks, including Openswan and Windows 2000/XP. If you have any difficulties with this process, please e-mail the <a href="http://lists.openswan.org/">Openswan mailing list</a>, or if you can&#8217;t get help from there, e-mail me at: <a href="mailto:ipsec@natecarlson.com">ipsec@natecarlson.com</a>. If you are using clients which benefit from receiving an IP address on the remote network (Windows, PocketPC, etc), you may want to consider L2TP over IPSec instead of the method described below. <a href="http://www.jacco2.dds.nl/networking/freeswan-l2tp.html">Jacco de Leeuw&#8217;s pages</a> cover this in a good amount of detail; I also have a basic walkthrough available at <a href="http://www.natecarlson.com/linux/ipsec-l2tp.php">my L2TP-over-IPsec page</a>.</p>
<p>If you&#8217;re not sure if IPSec is right for you, I have written a quick document about some of the various types of VPN available under Linux. It is available at: <a href="http://www.natecarlson.com/linux/linux-vpn.php">http://www.natecarlson.com/linux/linux-vpn.php</a>. I hope this helps clear up some questions.</p>
<p><strong>IMPORTANT NOTE:</strong> On March 1, 2004, the FreeS/WAN maintainers announced that the FreeS/WAN project is ending, for many reasons. The <a href="http://www.openswan.org">Openswan project</a> is going to be taking over development. Openswan is based on Super FreeS/WAN, and already includes most of the patches that people wanted. I&#8217;ve updated these directions to use examples for Openswan 2.1.2; they should still run as-is on FreeS/WAN 2.0 with the X.509 patches, and will work with FreeS/WAN 1.99+X.509 and Openswan 1 with some minor modifications. They should also work as-is with Strongswan. I no longer cover patching FreeS/WAN with X.509; if you are going to start with a base FreeS/WAN installation, you will need to follow the directions at <a href="http://www.strongsec.com/freeswan/">http://www.strongsec.com/freeswan</a> on how to patch it.</p>
<p><strong>IMPORTANT NOTE #2:</strong> As of June 17 2004, this document has been updated to reflect Openswan configuration instead of FreeS/WAN. I&#8217;ve also reorganized a few things; hopefully it will flow better now. Please let me know if you run into any problems with the new configuration. If you need it, the old page is available at: <a href="http://www.natecarlson.com/linux/ipsec-x509-fs1.php">http://www.natecarlson.com/linux/ipsec-x509-fs1.php</a>.</p>
<p><strong>NOTE #3:</strong> Not nearly as important as above, but just wanted to note that I do occasionally post notes about new VPN options and such on my blog; see the VPN category at: <a href="http://www.natecarlson.com/category/geek-stuff/vpn/">http://www.natecarlson.com/category/geek-stuff/vpn</a>. Also, if you are interested in consulting services to help you set things up, I am available on a very limited basis &#8211; please see my <a href="/consulting">consulting page</a>.</p>
<p>Contents:<br />
<a href="#casetup">Setting up a Certificate Authority</a><br />
<a href="#gencert">Generating a Certificate</a><br />
<a href="#installing">Installing Openswan</a><br />
<a href="#installgwcert">Installing the Certificate on your Gateway</a><br />
<a href="#configgw">Configuring Openswan on the Gateway Machine</a><br />
<a href="#clientopenswan">Client Setup: Openswan</a><a href="#clientwin"></a><br />
<a href="#clientwin">Client Setup: Windows 2000/XP with ipsec.exe</a><br />
<a href="#trouble">Some common errors, and resolutions for them</a><br />
<a href="#references">References used to write this document</a></p>
<p><center><script type="text/javascript"><!--
google_ad_client = "pub-2600332485776111";
/* 728x90 page bottom ad */
google_ad_slot = "7834445648";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></center></p>
<p><a name="casetup"><strong>Setting up your Certificate Authority</strong></a></p>
<p>For the sake of this document, I&#8217;m assuming you want to use X.509 certificates for authentication. It is possible to use RSA keys or pre-shared keys, but I find the X.509 method to be the most scalable and easiest to maintain for a decent-sized user base. I am also assuming that you will need your own Certificate Authority dedicated to VPN usage &#8211; if you already have access to a CA, you may just want to generate certificates from there (if that&#8217;s the case, you can just skim this section.) If you need more details that I am going into here, please read the OpenSSL documentation &#8212; it&#8217;s fairly detailed. For CA certificate management, my examples use the utilities included with OpenSSL itself &#8211; there are third-party tools out there that make this a bit simpler, but I want to keep dependencies low. Note that you do not necessarily need to use your Openswan gateway as the Certificate Authority &#8211; it can be any box with OpenSSL installed. In fact, it may be better to use a different box, so if an attacker gains access to your Openswan gateway they don&#8217;t have access to your CA, too. If you have any suggestions on how to make this process simpler, please let me know!</p>
<p>Now, on to the good stuff &#8211; let&#8217;s start setting up our own CA.</p>
<p>1) Find your openssl.cnf file. This file has default values for OpenSSL certificate generation. Here&#8217;s a few locations for various distributions:</p>
<p>Debian: /etc/ssl/openssl.cnf<br />
RedHat 7.x+: /usr/share/ssl/openssl.cnf</p>
<p>Open this file in your favorite editor. We will need to change the following options:</p>
<p>&#8216;default_days&#8217;: This is the length of time, in days, that your certificates will be valid for, and defaults to 365 days, or 1 year. I recommend setting this to &#8216;3650&#8242;, as that will give you 10 years of validity on your certificates. Since this is for internal use, I am ok with the security ramifications of having a certificate valid for a long time &#8211; if you lose it or whatnot, you can revoke it without a problem.</p>
<p>&#8216;[ req_distinguished_name ]&#8216; section: You don&#8217;t really *need* to change the options below req_distinguished_name; they just set the default options (such as location, company name, etc) for certificate generation. I find it&#8217;s easier to set them here than re-type them for every certificate.</p>
<p>2) Create a directory to house your CA. I generally use something like /var/sslca; you can really use whatever you want. Change the permissions of the directory to 700, so that people will not be able to access the private keys who aren&#8217;t supposed to.</p>
<p>3) Find the command &#8216;CA.sh&#8217; (some distributions rename it to just &#8216;CA&#8217;; don&#8217;t ask me why.) Locations on various distributions:</p>
<p>Debian: /usr/lib/ssl/misc/CA.sh<br />
RedHat 7.x+: /usr/share/ssl/misc/CA</p>
<p>Edit this file, and change the line that says &#8216;DAYS=&#8221;days 365&#8243;&#8216; to a very high number (this sets how long the certificate authority&#8217;s certificate is valid.) Be sure that this number is higher than the number is Step 1; or else Windows may not accept your certificates. Note that if this number is too high, it can cause problems &#8211; I generally set it for 15-20 years.</p>
<p>4) Run the command &#8216;CA.sh -newca&#8217;. Follow the prompts, as below. Example input is in red, and my comments are in blue. Be sure to not use any non-alphanumeric characters, such as dashes, commas, plus signs, etc. These characters may make things more difficult for you.</p>
<p><code>nate@example:~/sslca$ <em>/usr/lib/ssl/misc/CA.sh -newca</em><br />
CA certificate filename (or enter to create) <em>(enter)</em><br />
Making CA certificate ...<br />
Using configuration from /usr/lib/ssl/openssl.cnf<br />
Generating a 1024 bit RSA private key<br />
.............................................................................+++<br />
........................................+++<br />
writing new private key to './demoCA/private/./cakey.pem'<br />
Enter PEM pass phrase:<em>(enter password --this is the password you will need to create any other certificates.)</em><br />
Verifying password - Enter PEM pass phrase: <em>(repeat password)</em><br />
-----<br />
You are about to be asked to enter information that will be incorporated<br />
into your certificate request.<br />
What you are about to enter is what is called a Distinguished Name or a DN.<br />
There are quite a few fields but you can leave some blank<br />
For some fields there will be a default value,<br />
If you enter '.', the field will be left blank.<br />
-----<br />
Country Name (2 letter code) [AU]: (Enter your country code here)<br />
State or Province Name (full name) [Some-State]: (Enter your state/province here)<br />
Locality Name (eg, city) []: (Enter your city here)<br />
Organization Name (eg, company) [Internet Widgits Pty Ltd]: (Enter your company name here, or leave blank)<br />
Organizational Unit Name (eg, section) []: (OU, if you like. I usually leave it blank.)<br />
Common Name (eg, YOUR name) []: (The name of your Certificate Authority)<br />
Email Address []:(E-Mail Address)<br />
nate@example:~/sslca$<br />
</code></p>
<p>Let&#8217;s also generate a crl file, which you&#8217;ll need on your gateway boxes:</p>
<p><span class="ipsecExample"><br />
nate@example:~/sslca$ <span class="ipsecExampleInput">openssl ca -gencrl -out crl.pem</span><br />
</span></p>
<p>You&#8217;ll need to update this CRL file any time you revoke a certificate.</p>
<p>That&#8217;s it, you now have your own certificate authority that you can use to generate certificates.</p>
<p><a name="gencert"><strong>Generating a Certificate</strong></a></p>
<p>You will need to generate a certificate for every machine that will be making an IPSec connection. This includes the gateway host, and each of your client machines. This section details how to create the certificate, and convert it to formats needed for Windows and such.</p>
<p>Again, we&#8217;ll be using the CA.sh script. Except this time, instead of telling it to create a new Certificate Authority, we&#8217;re telling it to request, then sign a certificate:</p>
<p><span class="ipsecExample"><br />
nate@example:~/sslca$ <span class="ipsecExampleInput">/usr/lib/ssl/misc/CA.sh -newreq</span></span></p>
<p>Using configuration from /usr/lib/ssl/openssl.cnf</p>
<p>Generating a 1024 bit RSA private key</p>
<p>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..+++</p>
<p>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.+++</p>
<p>writing new private key to &#8216;newreq.pem&#8217;</p>
<p>Enter PEM pass phrase:<span class="ipsecExampleInput">(enter password)</span> <span class="ipsecExampleComment">Password to encrypt the new cert&#8217;s private key with &#8211; you&#8217;ll need this!</span></p>
<p>Verifying password &#8211; Enter PEM pass phrase:<span class="ipsecExampleInput">(repeat password)</span></p>
<p>&#8212;&#8211;</p>
<p>You are about to be asked to enter information that will be incorporated</p>
<p>into your certificate request.</p>
<p>What you are about to enter is what is called a Distinguished Name or a DN.</p>
<p>There are quite a few fields but you can leave some blank</p>
<p>For some fields there will be a default value,</p>
<p>If you enter &#8216;.&#8217;, the field will be left blank.</p>
<p>&#8212;&#8211;</p>
<p>Country Name (2 letter code) [AU]:<span class="ipsecExampleInput">US(enter)</span></p>
<p>State or Province Name (full name) [Some-State]:<span class="ipsecExampleInput">State(enter)</span></p>
<p>Locality Name (eg, city) []:<span class="ipsecExampleInput">City(enter)</span></p>
<p>Organization Name (eg, company) [Internet Widgits Pty Ltd]:<span class="ipsecExampleInput">ExampleCo(enter)</span></p>
<p>Organizational Unit Name (eg, section) []:<span class="ipsecExampleInput">(enter)</span></p>
<p>Common Name (eg, YOUR name) []:<span class="ipsecExampleInput">host.example.com(enter)</span><span class="ipsecExampleComment">This can be a hostname, a real name, an e-mail address, or whatever</span></p>
<p>Email Address []:<span class="ipsecExampleInput">user@example.com(enter) (optional)</span></p>
<p>Please enter the following &#8216;extra&#8217; attributes</p>
<p>to be sent with your certificate request</p>
<p>A challenge password []:<span class="ipsecExampleInput">(enter)</span></p>
<p>An optional company name []:<span class="ipsecExampleInput">(enter)</span></p>
<p>Request (and private key) is in newreq.pem</p>
<p>What we just did is generate a Certificate Request &#8211; this is the same type of request that you would send to Thawte or Verisign to get a generally-accepted SSL certificate. For our uses, however, we&#8217;ll sign it with our own CA:</p>
<p><span class="ipsecExample"><br />
nate@example:~/sslca$ <span class="ipsecExampleInput">/usr/lib/ssl/misc/CA.sh -sign</span></span></p>
<p>Using configuration from /usr/lib/ssl/openssl.cnf</p>
<p>Enter PEM pass phrase:<span class="ipsecExampleInput">(password you entered when creating the ca)</span></p>
<p>Check that the request matches the signature</p>
<p>Signature ok</p>
<p>The Subjects Distinguished Name is as follows</p>
<p>countryName           :PRINTABLE:&#8217;US&#8217;</p>
<p>stateOrProvinceName   :PRINTABLE:&#8217;State&#8217;</p>
<p>localityName          :PRINTABLE:&#8217;City&#8217;</p>
<p>organizationName      :PRINTABLE:&#8217;ExampleCo&#8217;</p>
<p>commonName            :PRINTABLE:&#8217;host.example.com&#8217;</p>
<p>emailAddress          :IA5STRING:&#8217;user@example.com&#8217;</p>
<p>Certificate is to be certified until Feb 13 16:28:40 2012 GMT (3650 days)</p>
<p>Sign the certificate? [y/n]:<span class="ipsecExampleInput">y(enter)</span></p>
<p>1 out of 1 certificate requests certified, commit? [y/n]<span class="ipsecExampleInput">y(enter)</span></p>
<p>Write out database with 1 new entries</p>
<p>Data Base Updated</p>
<p><span class="ipsecExampleComment">(certificate snipped)</span></p>
<p>Signed certificate is in newcert.pem</p>
<p>Next, move the output files to names that make a bit more sense for future reference.</p>
<p><span class="ipsecExample"><br />
nate@example:~/sslca$ mv newcert.pem host.example.com.pem</span></p>
<p>nate@example:~/sslca$ mv newreq.pem host.example.com.key</p>
<p>That&#8217;s all that&#8217;s required for Openswan boxes &#8211; you&#8217;ll need these two files, along with the file &#8216;cacert.pem&#8217; from the &#8216;demoCA&#8217; directory, and the &#8216;crl.pem&#8217; file you generated earlier.</p>
<p>If this certificate is needed for a Windows box, you&#8217;ll need to convert it to a p12 format:</p>
<p><span class="ipsecExample">$ openssl pkcs12 -export -in winhost.example.com.pem -inkey winhost.example.com.key -certfile demoCA/cacert.pem -out winhost.example.com.p12</span></p>
<p><!-- You will NOT be able to see the ad on your site! This unit is hidden on your page, and will only display to your search engine traffic (from US and CA). To preview, paste the code up on your site, then add #chitikatest=mortgage to the end of your URL in your browser's address bar.  Example:  www.yourwebsite.com#chitikatest=mortgage. This will show you what the ad would look like to a user who is interested in "mortgages." -->
<script type="text/javascript"><!--
ch_client = "natecarlson";
ch_type = "mpu";
ch_width = 728;
ch_height = 90;
ch_non_contextual = 4;
ch_vertical ="premium";
ch_sid = "Chitika Premium";
var ch_queries = new Array( );
var ch_selected=Math.floor((Math.random()*ch_queries.length));
if ( ch_selected < ch_queries.length ) {
ch_query = ch_queries[ch_selected];
}
//--></script>
<script  src="http://scripts.chitika.net/eminimalls/amm.js" type="text/javascript">
</script></p>
<p><a name="installing"><strong>Installing Openswan</strong></a></p>
<p>You&#8217;ll need to install Openswan each Linux box you want to speak IPSec.</p>
<p>Openswan now integrates all of the important patches, including X.509 and NAT Traversal. If you want to build it from scratch, you can download it from <a href="http://www.openswan.org/code/">http://www.openswan.org/code</a>, and follow the installation directions included with the package.</p>
<p>You now have two options for which IPSec stack you want to install in the kernel &#8211; you can either use Openswan&#8217;s IPSec stack (Klips), or use the built-in IPSec stack in the 2.6 kernel (26sec). If you are running on a stock 2.4 kernel, the only option is Klips. You&#8217;ll need to patch NAT Traversal support into your kernel (if you intend to use it), and build the ipsec.o kernel module. Otherwise, if you are using a 2.6 kernel or a 2.4 kernel with backported 26sec support (such as the kernel Debian provides), you don&#8217;t need to touch the kernel-land at all &#8211; you can just install the Openswan user-land utilities and go. Note that there isn&#8217;t as of yet an option to use Klips on the 2.6 kernel; it is on the Openswan developer&#8217;s to-do list, but isn&#8217;t a real high priority.</p>
<p>You&#8217;ll also need the user-land utilities. If you are installing from source, &#8216;make programs ; make install&#8217; should get you what you need. Otherwise, if you are running Debian testing or unstable, you can just run &#8216;apt-get install openswan&#8217; to get the user level utilities. ATrpms provides a Openswan package for recent versions of RedHat and Fedora Core; for more information on that, see <a href="http://atrpms.net">http://atrpms.net</a>.</p>
<p>Once you&#8217;ve selected and set up your IPSec stack and installed the user-land programs, you&#8217;re ready to move on to configuring Openswan.</p>
<p><a name="installgwcert"><strong>Installing the Certificate on your Gateway</strong></a></p>
<p>This discusses how to install the certificate on your gateway machine. These same steps apply for installing the cert on Openswan clients, too. I&#8217;m assuming you&#8217;ve already created a certificate for each machine (see the &#8220;Generating a Certificate&#8221; section) &#8211; if that&#8217;s not the case, please go back and do that now.</p>
<p>1) Install the files in their proper locations (if installing to a remote machine, please be sure to copy the files in a secure manner):</p>
<p><span class="ipsecExample"> </span></p>
<p>$ cp /var/sslca/host.example.com.key /etc/ipsec.d/private</p>
<p>$ cp /var/sslca/host.example.com.pem /etc/ipsec.d/certs</p>
<p>$ cp /var/sslca/demoCA/cacert.pem /etc/ipsec.d/cacerts</p>
<p>$ cp /var/sslca/crl.pem /etc/ipsec.d/crls/crl.pem</p>
<p><a name="configgw"><strong>Configuring Openswan on the Gateway Machine</strong></a></p>
<p>1) Configure ipsec.secrets:</p>
<p>/etc/ipsec.secrets should contain the following:</p>
<p><span class="ipsecExample"> </span></p>
<p>: RSA host.example.com.key &#8220;password&#8221;<br />
The password above should be the PEM passphrase that you entered while generating the SSL certificate.</p>
<p>2) Configuring ipsec.conf</p>
<p>/etc/ipsec.conf should look something like the configuration below (note that the indentation is important; without it, openswan will fail):</p>
<p><span class="ipsecExample"> </span></p>
<p>version 2.0</p>
<p>config setup</p>
<p><span class="ipsecTabbedExample">interfaces=%defaultroute</span></p>
<p><span class="ipsecTabbedExample">nat_traversal=yes</span></p>
<p><span class="ipsecTabbedExample">virtual_private=%v4:10.0.0.0/8,%v4:172.16.0.0/12,%v4:192.168.0.0/16</span></p>
<p>conn %default</p>
<p><span class="ipsecTabbedExample">keyingtries=1</span></p>
<p><span class="ipsecTabbedExample">compress=yes</span></p>
<p><span class="ipsecTabbedExample">disablearrivalcheck=no</span></p>
<p><span class="ipsecTabbedExample">authby=rsasig</span></p>
<p><span class="ipsecTabbedExample">leftrsasigkey=%cert</span></p>
<p><span class="ipsecTabbedExample">rightrsasigkey=%cert</span></p>
<p>conn roadwarrior-net</p>
<p><span class="ipsecTabbedExample">leftsubnet=(your_subnet)/(your_netmask)</span></p>
<p><span class="ipsecTabbedExample">also=roadwarrior</span></p>
<p>conn roadwarrior</p>
<p><span class="ipsecTabbedExample">left=%defaultroute</span></p>
<p><span class="ipsecTabbedExample">leftcert=host.example.com.pem</span></p>
<p><span class="ipsecTabbedExample">right=%any</span></p>
<p><span class="ipsecTabbedExample">rightsubnet=vhost:%no,%priv</span></p>
<p><span class="ipsecTabbedExample">auto=add</span></p>
<p><span class="ipsecTabbedExample">pfs=yes</span></p>
<p>conn block</p>
<p><span class="ipsecTabbedExample">auto=ignore</span></p>
<p>conn private</p>
<p><span class="ipsecTabbedExample">auto=ignore</span></p>
<p>conn private-or-clear</p>
<p><span class="ipsecTabbedExample">auto=ignore</span></p>
<p>conn clear-or-private</p>
<p><span class="ipsecTabbedExample">auto=ignore</span></p>
<p>conn clear</p>
<p><span class="ipsecTabbedExample">auto=ignore</span></p>
<p>conn packetdefault</p>
<p><span class="ipsecTabbedExample">auto=ignore</span></p>
<p>This configuration will set things up so anyone with a valid certificate signed by your CA will be able to connect to your host. There are two connection profiles: one for a connection directly to the gateway, and one for the client to connect to the network behind the gateway. This configuration also includes NAT Traversal configuration that will allow anyone a host behind a NAT gateway using RFC1918 private addresses (defined in the &#8216;virtual_private&#8217; line) to connect. All of the &#8216;auto=ignore&#8217; entries are used to disable Opportunistic Encryption (OE), as it can cause problems if not configured properly.</p>
<p>If you are planning on having Windows boxes connect to your host using L2TP over IPSec, you&#8217;ll also need the following connections, somewhere above the &#8216;roadwarrior&#8217; definition:</p>
<p><span class="ipsecExample"><br />
conn roadwarrior-l2tp</span></p>
<p><span class="ipsecTabbedExample">pfs=no</span></p>
<p><span class="ipsecTabbedExample">leftprotoport=17/0</span></p>
<p><span class="ipsecTabbedExample">rightprotoport=17/1701</span></p>
<p><span class="ipsecTabbedExample">also=roadwarrior</span></p>
<p>conn roadwarrior-l2tp-updatedwin</p>
<p><span class="ipsecTabbedExample">pfs=no</span></p>
<p><span class="ipsecTabbedExample">leftprotoport=17/1701</span></p>
<p><span class="ipsecTabbedExample">rightprotoport=17/1701</span></p>
<p><span class="ipsecTabbedExample">also=roadwarrior</span></p>
<p>In addition, if you want to have clients tunnel all traffic via IPSec, you&#8217;ll need a connection that allows that. The following is what I recommend (again, add above roadwarrior):</p>
<p><span class="ipsecExample"><br />
conn roadwarrior-all</span></p>
<p><span class="ipsecTabbedExample">leftsubnet=0.0.0.0/0</span></p>
<p><span class="ipsecTabbedExample">also=roadwarrior</span></p>
<p><a name="clientopenswan"><strong>Client Setup: Openswan</strong></a></p>
<p>1) Follow the steps under &#8216;<a href="#gencert">Generating a Certificate</a>&#8216; to create a new certificate for the client machine, modifying file names and such as needed. (We will refer to the files for this client as &#8216;clienthost.example.com&#8217;.)</p>
<p>2) Copy the following files (in a secure fashion) over to your client:</p>
<p>host.example.com.pem (your gateway&#8217;s certificate file)</p>
<p>clienthost.example.com.key</p>
<p>clienthost.example.com.pem</p>
<p>cacert.pem</p>
<p>crl.pem</p>
<p>3) Copy the files into their proper locations:</p>
<p><span class="ipsecExample"><br />
$ cp clienthost.example.com.key /etc/ipsec.d/private</span></p>
<p>$ cp clienthost.example.com.pem /etc/ipsec.d/certs</p>
<p>$ cp host.example.com.pem /etc/ipsec.d/certs</p>
<p>$ cp crl.pem /etc/ipsec.d/crls</p>
<p>$ cp cacert.pem /etc/ipsec.d/cacerts/cacert.pem</p>
<p>4) Configure ipsec:</p>
<p>ipsec.secrets:</p>
<p><span class="ipsecExample"> </span></p>
<p>: RSA clienthost.example.com.key &#8220;password&#8221;</p>
<p>ipsec.conf:</p>
<p><span class="ipsecExample"><br />
</span></p>
<p>version 2</p>
<p>config setup</p>
<p><span class="ipsecTabbedExample">interfaces=%defaultroute</span></p>
<p><span class="ipsecTabbedExample">nat_traversal=yes</span></p>
<p>conn %default</p>
<p><span class="ipsecTabbedExample">keyingtries=1</span></p>
<p><span class="ipsecTabbedExample">compress=yes</span></p>
<p><span class="ipsecTabbedExample">authby=rsasig</span></p>
<p><span class="ipsecTabbedExample">leftrsasigkey=%cert</span></p>
<p><span class="ipsecTabbedExample">rightrsasigkey=%cert</span></p>
<p>conn roadwarrior-net</p>
<p><span class="ipsecTabbedExample">leftsubnet=(your_subnet)/(your_netmask)</span></p>
<p><span class="ipsecTabbedExample">also=roadwarrior</span></p>
<p>conn roadwarrior</p>
<p><span class="ipsecTabbedExample">left=(ip.of.host)</span></p>
<p><span class="ipsecTabbedExample">leftcert=host.example.com.pem</span></p>
<p><span class="ipsecTabbedExample">right=%defaultroute</span></p>
<p><span class="ipsecTabbedExample">rightcert=clienthost.example.com.pem</span></p>
<p><span class="ipsecTabbedExample">auto=add</span></p>
<p><span class="ipsecTabbedExample">pfs=yes</span></p>
<p>conn block</p>
<p><span class="ipsecTabbedExample">auto=ignore</span></p>
<p>conn private</p>
<p><span class="ipsecTabbedExample">auto=ignore</span></p>
<p>conn private-or-clear</p>
<p><span class="ipsecTabbedExample">auto=ignore</span></p>
<p>conn clear-or-private</p>
<p><span class="ipsecTabbedExample">auto=ignore</span></p>
<p>conn clear</p>
<p><span class="ipsecTabbedExample">auto=ignore</span></p>
<p>conn packetdefault</p>
<p><span class="ipsecTabbedExample">auto=ignore</span></p>
<p>5) Start the VPN link, and make sure everything works:</p>
<p><span class="ipsecExample"><br />
# /etc/init.d/ipsec restart</span></p>
<p>$ ipsec auto &#8211;up roadwarrior</p>
<p>$ ipsec auto &#8211;up roadwarrior-net</p>
<p>6) If you would like to have the links start automatically, change &#8216;auto=add&#8217; to &#8216;auto=start&#8217;.</p>
<p><a name="clientwin"><strong>Client Setup: Windows 2000/XP</strong></a></p>
<p>NOTE: If you have previously installed SSH Sentinel, and want to use the built-in Windows IPSec stack, you will need to uninstall (or disable) SSH Sentinel, and enable the &#8216;ipsec&#8217; service. I know this has tripped a few people up. This also applies for any other IPSec client you may have installed &#8211; you *need* to make sure it&#8217;s disabled before trying to use the built in IPSec service.</p>
<p>NOTE #2: The HTML guy at my previous employer went through and made screenshots of the process of importing a certificate. These screenshots are available at <a href="http://support.real-time.com/open-source/ipsec/index.html">http://support.real-time.com/open-source/ipsec/index.html</a>. Please do NOT e-mail Real Time with any questions related to this; I no longer work there, and don&#8217;t want them to get a flood of questions about this.</p>
<p>1) Create the certificate, again following the steps under &#8216;<a href="#gencert">Generating a Certificate</a>&#8216;. We&#8217;ll assume that you call the Windows 2000 certificate &#8216;winhost.example.com&#8217;. You&#8217;ll need to follow the directions to output a .p12 file.</p>
<p>Also run the following, and make a note of it&#8217;s output:</p>
<p><span class="ipsecExample"> </span></p>
<p>$ openssl x509 -in demoCA/cacert.pem -noout -subject</p>
<p>You will need this for your VPN configuration.</p>
<p>2) Copy this file over to the Windows machine in a secure fashion, such as &#8217;scp&#8217; or with a floppy disk. Don&#8217;t use FTP!</p>
<p>3) Download Marcus Müller&#8217;s ipsec.exe utility from <a href="http://vpn.ebootis.de">http://vpn.ebootis.de</a>and unzip it  to some directory on your Windows machine (I generally use c:\ipsec)</p>
<p>4) Create a IPSEC + Certificates MMC</p>
<p>Start/Run/MMC</p>
<p>File (or Console) &#8211; Add/Remove Snap-in</p>
<p>Click on &#8216;Add&#8217;</p>
<p>Click on &#8216;Certificates&#8217;, then &#8216;Add&#8217;</p>
<p>Select &#8216;Computer Account&#8217;, and &#8216;Next&#8217;.</p>
<p>Select &#8216;Local computer&#8217;, and &#8216;Finish&#8217;.</p>
<p>Click on &#8216;IP Security Policy Management&#8217;, and &#8216;Add&#8217;.</p>
<p>Select &#8216;Local Computer&#8217;, and &#8216;Finish&#8217;</p>
<p>Click &#8216;Close&#8217; then &#8216;OK&#8217;</p>
<p>5) Add the certificate</p>
<p>Click the plus arrow by &#8216;Certificates (Local Computer)&#8217;</p>
<p>Right-click &#8216;Personal&#8217;, and click &#8216;All Tasks&#8217; then &#8216;Import&#8217;</p>
<p>Click Next</p>
<p>Type in the path to the .p12 file (or browse and select the file), and click &#8216;Next&#8217;</p>
<p>Type the export password, and click Next</p>
<p>Select &#8216;Automatically select the certificate store based on the type of certificate&#8217;, and click Next</p>
<p>Click Finish, and say yes to any prompts that pop up</p>
<p>Exit the MMC, and save it as a file so you don&#8217;t have to re-add the Snap Ins each time</p>
<p>6) Set up the IPSec utility</p>
<p>Install ipsecpol.exe (Windows 2000) or ipseccmd.exe (Windows XP) as described in the documentation for the ipsec utility. Note that for Windows XP SP2, you&#8217;ll need a new version of ipseccmd.exe &#8211; it can be downloaded from <a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;838079">http://support.microsoft.com/default.aspx?scid=kb;en-us;838079</a>.</p>
<p>Edit your ipsec.conf (on the windows machine), replacing the &#8220;RightCA&#8221; with the output of the &#8216;openssl x509 -in demoCA/cacert.pem -noout -subject&#8217;; reformatted as below (you need to change the /&#8217;s to commas, and change the name of some of the fields &#8212; just follow the example below):</p>
<p><span class="ipsecExample"> </span></p>
<p>conn roadwarrior</p>
<p><span class="ipsecTabbedExample">left=%any</span></p>
<p><span class="ipsecTabbedExample">right=(ip_of_remote_system)</span></p>
<p><span class="ipsecTabbedExample">rightca=&#8221;C=US,S=State,L=City,O=ExampleCo,CN=CA,Email=host@example.com&#8221;</span></p>
<p><span class="ipsecTabbedExample">network=auto</span></p>
<p><span class="ipsecTabbedExample">auto=start</span></p>
<p><span class="ipsecTabbedExample">pfs=yes</span></p>
<p>conn roadwarrior-net</p>
<p><span class="ipsecTabbedExample">left=%any</span></p>
<p><span class="ipsecTabbedExample">right=(ip_of_remote_system)</span></p>
<p><span class="ipsecTabbedExample">rightsubnet=(your_subnet)/(your_netmask)</span></p>
<p><span class="ipsecTabbedExample">rightca=&#8221;C=US,S=State,L=City,O=ExampleCo,CN=CA,Email=host@example.com&#8221;</span></p>
<p><span class="ipsecTabbedExample">network=auto</span></p>
<p><span class="ipsecTabbedExample">auto=start</span></p>
<p><span class="ipsecTabbedExample">pfs=yes</span></p>
<p>If you would like to encrypt all data over the tunnel, the following should work (if you have set up the Linux side properly):</p>
<p><span class="ipsecExample"><br />
</span></p>
<p>conn roadwarrior-all</p>
<p><span class="ipsecTabbedExample">left=%any</span></p>
<p><span class="ipsecTabbedExample">right=(ip_of_remote_system)</span></p>
<p><span class="ipsecTabbedExample">rightsubnet=*</span></p>
<p><span class="ipsecTabbedExample">rightca=&#8221;C=US,S=State,L=City,O=ExampleCo,CN=CA,Email=host@example.com&#8221;</span></p>
<p><span class="ipsecTabbedExample">network=auto</span></p>
<p><span class="ipsecTabbedExample">auto=start</span></p>
<p><span class="ipsecTabbedExample">pfs=yes</span></p>
<p>7) Start the link</p>
<p>Run the command &#8216;ipsec.exe&#8217;. Here&#8217;s example output:</p>
<p><span class="ipsecExample"><br />
C:\ipsec&gt;ipsec</span></p>
<p>IPSec Version 2.1.4 (c) 2001,2002 Marcus Mueller</p>
<p>Getting running Config &#8230;</p>
<p>Microsoft&#8217;s Windows XP identified</p>
<p>Host name is: (local_hostname)</p>
<p>No RAS connections found.</p>
<p>LAN IP address: (local_ip_address)</p>
<p>Setting up IPSec &#8230;</p>
<p>Deactivating old policy&#8230;</p>
<p>Removing old policy&#8230;</p>
<p>Connection roadwarrior:</p>
<p>MyTunnel     : (local_ip_address)</p>
<p>MyNet        : (local_ip_address)/255.255.255.255</p>
<p>PartnerTunnel: (ip_of_remote_system)</p>
<p>PartnerNet   : (ip_of_remote_system)/255.255.255.255</p>
<p>CA (ID)      : C=US,S=State,L=City,O=ExampleCo,&#8230;</p>
<p>PFS          : y</p>
<p>Auto         : start</p>
<p>Auth.Mode    : MD5</p>
<p>Rekeying     : 3600S/50000K</p>
<p>Activating policy&#8230;</p>
<p>Connection roadwarrior-net:</p>
<p>MyTunnel     : (local_ip_address)</p>
<p>MyNet        : (local_ip_address)/255.255.255.255</p>
<p>PartnerTunnel: (ip_of_remote_system)</p>
<p>PartnerNet   : (remote_subnet)/(remote_netmask)</p>
<p>CA (ID)      : C=US,S=State,L=City,O=ExampleCo,&#8230;</p>
<p>PFS          : y</p>
<p>Auto         : start</p>
<p>Auth.Mode    : MD5</p>
<p>Rekeying     : 3600S/50000K</p>
<p>Activating policy&#8230;</p>
<p>C:\ipsec&gt;</p>
<p>Now, ping your gateway host. It should say &#8216;Negotiating IP Security&#8217; a few times, and then give you ping responses. Note that this may take a few tries; from a T1 hitting a VPN server on a cable modem, it usually takes 3-4 pings. Do the same for the internal network on the remote end, and you should be up!</p>
<p><center><script type="text/javascript"><!--
google_ad_client = "pub-2600332485776111";
/* 728x90 page bottom ad */
google_ad_slot = "7834445648";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></center></p>
<p><a name="trouble"><strong>Some common errors, and resolutions for them</strong></a></p>
<p>I&#8217;ve tried to make it as simple as possible to follow the above instructions, but sometimes it just doesn&#8217;t quite work right.  :)  If you have trouble, feel free to <a href="mailto:ipsec@natecarlson.com">e-mail me</a>, or join the FreeS/WAN mailing list and ask your questions there (many times, you will get a quicker response there, as there are more people listening at any given time, and most of them are smarter than me!). But, just in case you&#8217;ve got one of the really common problems, here&#8217;s a few problems and solutions:</p>
<p>1) Logging on the Windows side (helps troubleshoot certificate errors, etc)</p>
<p>Yes, it is actually possible to enable logging on the Windows box! To do this, follow the directions at Microsoft&#8217;s <a href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;q257225">Basic IPSec Troubleshooting in Windows 2000</a> page &#8212; look for the section entitled &#8216;Obtaining an Oakley Log&#8217;.</p>
<p>2) Pinging from the Windows side shows &#8216;Negotiating IP Security&#8217;, but the tunnel never comes up!</p>
<p>This is one of the most common problems people have, and is usually caused by problems with rightca= on the Windows side. To verify that you have that set properly, follow these instructions:</p>
<p>- Load the IPSec MMC you created earlier</p>
<p>- Click IP Security Policies; double-click on the FreeSwan tunnel</p>
<p>- Double-click roadwarrior-Host filter</p>
<p>- Click on the &#8216;Authentication Methods&#8217; tab</p>
<p>- Click &#8216;Add&#8217;, then &#8216;Use a certificate from this CA&#8217;</p>
<p>- Click Browse, find your CA</p>
<p>- Copy/paste the text in the grayed-out box into your ipsec.conf</p>
<p>In many cases, that&#8217;ll clear up the issues &#8211; if it doesn&#8217;t, check your log for errors.</p>
<p>More troubleshooting tips to come soon, assuming I get time to write them.  :)</p>
<p>Let me know if the above doesn&#8217;t make sense, and I&#8217;ll try to help you out.  :)</p>
<p><a name="references"><strong>References</strong></a></p>
<p>FreeS/WAN Documentation: <a href="http://www.freeswan.org">http://www.freeswan.org</a></p>
<p>X.509 Patch Documentation: <a href="http://www.strongsec.com/freeswan/">http://www.strongsec.com/freeswan</a></p>
<p>The Windows 2000 VPN Tool Documentation: <a href="http://vpn.ebootis.de/">http://vpn.ebootis.de</a></p>
<p>Microsoft&#8217;s Basic IPSec Troubleshooting page: <a href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;q257225">http://support.microsoft.com/default.aspx?scid=kb;EN-US;q257225</a></p>


<p>Related posts:<ol><li><a href='http://www.natecarlson.com/2006/07/10/configuring-an-ipsec-tunnel-with-openswan-and-l2tpd/' rel='bookmark' title='Permanent Link: Configuring an IPsec tunnel with Openswan and l2tpd'>Configuring an IPsec tunnel with Openswan and l2tpd</a></li>
<li><a href='http://www.natecarlson.com/2005/11/22/apologies-to-people-asking-me-for-help-with-ipsec/' rel='bookmark' title='Permanent Link: apologies to people asking me for help with ipsec'>apologies to people asking me for help with ipsec</a></li>
<li><a href='http://www.natecarlson.com/2005/09/16/openswan-240-released/' rel='bookmark' title='Permanent Link: openswan 2.4.0 released'>openswan 2.4.0 released</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.natecarlson.com/2007/07/30/configuring-an-ipsec-tunnel-between-openswan-and-windows-2000-xp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuring an IPsec tunnel with Openswan and l2tpd</title>
		<link>http://www.natecarlson.com/2006/07/10/configuring-an-ipsec-tunnel-with-openswan-and-l2tpd/</link>
		<comments>http://www.natecarlson.com/2006/07/10/configuring-an-ipsec-tunnel-with-openswan-and-l2tpd/#comments</comments>
		<pubDate>Mon, 10 Jul 2006 17:36:04 +0000</pubDate>
		<dc:creator>nc</dc:creator>
				<category><![CDATA[VPN]]></category>
		<category><![CDATA[IPsec]]></category>
		<category><![CDATA[L2TP]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[X.509]]></category>

		<guid isPermaLink="false">http://www.natecarlson.com/?p=299</guid>
		<description><![CDATA[This document describes how to set up a VPN with Openswan combined with L2TPD. This provides for a more user-friendly experience than a standard IPSec VPN on many client operating systems. Note that for most sitesite VPN&#8217;s, you will still want straight IPSec.
If you&#8217;re not sure if IPSec is right for you, I have written [...]


Related posts:<ol><li><a href='http://www.natecarlson.com/2007/07/30/configuring-an-ipsec-tunnel-between-openswan-and-windows-2000-xp/' rel='bookmark' title='Permanent Link: Configuring an IPsec tunnel between Openswan and Windows 2000/XP with x509'>Configuring an IPsec tunnel between Openswan and Windows 2000/XP with x509</a></li>
<li><a href='http://www.natecarlson.com/2005/11/22/types-of-vpn-available-under-linux/' rel='bookmark' title='Permanent Link: Types of VPN available on Linux'>Types of VPN available on Linux</a></li>
<li><a href='http://www.natecarlson.com/2005/11/22/apologies-to-people-asking-me-for-help-with-ipsec/' rel='bookmark' title='Permanent Link: apologies to people asking me for help with ipsec'>apologies to people asking me for help with ipsec</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p></p><p>This document describes how to set up a VPN with <a href="http://www.openswan.org">Openswan</a> combined with L2TPD. This provides for a more user-friendly experience than a standard IPSec VPN on many client operating systems. Note that for most site<->site VPN&#8217;s, you will still want straight IPSec.</p>
<p>If you&#8217;re not sure if IPSec is right for you, I have written a quick document about some of the various types of VPN available under Linux. It is available at: <a href="http://www.natecarlson.com/linux/linux-vpn.php">http://www.natecarlson.com/linux/linux-vpn.php</a>. I hope this helps clear up some questions.</p>
<p>This page is heavily based on my basic IPSec configuration page, located at <a href="http://www.natecarlson.com/linux/ipsec-x509.php">http://www.natecarlson.com/linux/ipsec-x509.php</a>. The l2tpd configuration side is based on <a href="http://www.jacco2.dds.nl/networking/freeswan-l2tp.html">Jacco de Leeuw&#8217;s page</a>, which is the definitive source for anything related to Openswan and L2TP. I&#8217;m just trying to simplify things for the average Linux geek &#8212; if you need more detailed information, or information about any clients other than Windows, check out his page. If you have any difficulties with this process, please e-mail the <a href="http://lists.openswan.org/">Openswan mailing list</a>, or if you can&#8217;t get help from there, e-mail me at: <a href="mailto:ipsec@natecarlson.com">ipsec@natecarlson.com</a>.</p>
<p>All of my examples on this page are based on a Debian Sarge system, since all the packages required are readily available. Most examples are readily portable to other distributions; you will just need to get the required software for that distribution.</p>
<p><b>NOTE:</b> I do occasionally post notes about new VPN options and such on my blog; see the VPN category at: <a href="http://www.natecarlson.com/category/geek-stuff/vpn/">http://www.natecarlson.com/category/geek-stuff/vpn</a>. Also, if you are interested in consulting services to help you set things up, I am available on a very limited basis &#8211; please see my <a href="/consulting">consulting page</a>.</p>
<p><center><script type="text/javascript"><!--
google_ad_client = "pub-2600332485776111";
/* 728x90 page bottom ad */
google_ad_slot = "7834445648";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></center></p>
<p>Contents:<br />
<a href="#casetup">Setting up a Certificate Authority</a><br />
<a href="#gencert">Generating a Certificate</a><br />
<a href="#installing">Installing Openswan</a><br />
<a href="#installgwcert">Installing the Certificate on your Gateway</a><br />
<a href="#configgw">Configuring Openswan on the Gateway Machine</a><br />
<a href="#configl2tpd">Configuring l2tpd on the Gateway Machine</a></p>
<p><a href="#clientwinxp">Client Setup: Windows XP</a><br />
<a href="#clientipsec">Client Setup: Real IPSec Clients</a><br />
<a href="#trouble">Some common errors, and resolutions for them</a><br />
<a href="#references">References used to write this document</a></p>
<p><a name="casetup"><b>Setting up your Certificate Authority</b></a><br />
I&#8217;m assuming you want to use X.509 certificates for authentication. It may be possible to get this working with pre-shared keys, but I haven&#8217;t tried it. I am also assuming that you will need your own Certificate Authority dedicated to VPN usage &#8211; if you already have access to a CA, you may just want to generate certificates from there (if that&#8217;s the case, you can just skim this section.) If you need more details that I am going into here, please read the OpenSSL documentation &#8212; it&#8217;s fairly detailed. For CA certificate management, my examples use the utilities included with OpenSSL itself &#8211; there are third-party tools out there that make this a bit simpler, but I want to keep dependencies low. Note that you do not necessarily need to use your Openswan gateway as the Certificate Authority &#8211; it can be any box with OpenSSL installed. In fact, it may be better to use a different box, so if an attacker gains access to your Openswan gateway they don&#8217;t have access to your CA, too. If you have any suggestions on how to make this process simpler, please let me know!</p>
<p>Now, on to the good stuff &#8211; let&#8217;s start setting up our own CA.</p>
<p><center><!-- You will NOT be able to see the ad on your site! This unit is hidden on your page, and will only display to your search engine traffic (from US and CA). To preview, paste the code up on your site, then add #chitikatest=mortgage to the end of your URL in your browser's address bar.  Example:  www.yourwebsite.com#chitikatest=mortgage. This will show you what the ad would look like to a user who is interested in "mortgages." -->
<script type="text/javascript"><!--
ch_client = "natecarlson";
ch_type = "mpu";
ch_width = 728;
ch_height = 90;
ch_non_contextual = 4;
ch_vertical ="premium";
ch_sid = "Chitika Premium";
var ch_queries = new Array( );
var ch_selected=Math.floor((Math.random()*ch_queries.length));
if ( ch_selected < ch_queries.length ) {
ch_query = ch_queries[ch_selected];
}
//--></script>
<script  src="http://scripts.chitika.net/eminimalls/amm.js" type="text/javascript">
</script></center></p>
<p>
1) Install openssl. On Debian, &#8216;apt-get install openssl&#8217; will take care of this.<br />
2) Find your openssl.cnf file. This file has default values for OpenSSL certificate generation. Here&#8217;s a few locations for various distributions:</p>
<p>Debian: /etc/ssl/openssl.cnf<br />
RedHat 7.x+: /usr/share/ssl/openssl.cnf</p>
<p>Open this file in your favorite editor. We will need to change the following options:</p>
<p>&#8216;default_days&#8217;: This is the length of time, in days, that your certificates will be valid for, and defaults to 365 days, or 1 year. I recommend setting this to &#8216;3650&#8242;, as that will give you 10 years of validity on your certificates. Since this is for internal use, I am ok with the security ramifications of having a certificate valid for a long time &#8211; if you lose it or whatnot, you can revoke it without a problem.</p>
<p>&#8216;[ req_distinguished_name ]&#8216; section: You don&#8217;t really *need* to change the options below req_distinguished_name; they just set the default options (such as location, company name, etc) for certificate generation. I find it&#8217;s easier to set them here than re-type them for every certificate.</p>
<p>3) Create a directory to house your CA. I generally use something like /var/sslca; you can really use whatever you want. Change the permissions of the directory to 700, so that people will not be able to access the private keys who aren&#8217;t supposed to.</p>
<p>4) Find the command &#8216;CA.sh&#8217; (some distributions rename it to just &#8216;CA&#8217;; don&#8217;t ask me why.) Locations on various distributions:</p>
<p>Debian: /usr/lib/ssl/misc/CA.sh<br />
RedHat 7.x+: /usr/share/ssl/misc/CA</p>
<p>Edit this file, and change the line that says &#8216;DAYS=&#8221;days 365&#8243;&#8216; to a very high number (this sets how long the certificate authority&#8217;s certificate is valid.) Be sure that this number is higher than the number is Step 1; or else Windows may not accept your certificates. Note that if this number is too high, it can cause problems &#8211; I generally set it for 15-20 years.</p>
<p>5) Run the command &#8216;CA.sh -newca&#8217;. Follow the prompts, as below. Example input is in red, and my comments are in blue. Be sure to not use any non-alphanumeric characters, such as dashes, commas, plus signs, etc. These characters may make things more difficult for you.</p>
<p><code>nate@example:~/sslca$ <em>/usr/lib/ssl/misc/CA.sh -newca</em><br />
CA certificate filename (or enter to create)  <em>(press enter)</em><br />
Making CA certificate ...<br />
Using configuration from /usr/lib/ssl/openssl.cnf<br />
Generating a 1024 bit RSA private key<br />
.............................................................................+++<br />
........................................+++<br />
writing new private key to './demoCA/private/./cakey.pem'<br />
Enter PEM pass phrase: <em>(enter password --  This is the password you will need to create any other certificates.</em><br />
Verifying password - Enter PEM pass phrase:<em>(repeat password)</em><br />
-----<br />
You are about to be asked to enter information that will be incorporated<br />
into your certificate request.<br />
What you are about to enter is what is called a Distinguished Name or a DN.<br />
There are quite a few fields but you can leave some blank<br />
For some fields there will be a default value,<br />
If you enter '.', the field will be left blank.<br />
-----<br />
Country Name (2 letter code) [AU]: <em>(country -- enter your two-letter country code here</em><br />
State or Province Name (full name) [Some-State]: <em>(Enter your state/province here)</em><br />
Locality Name (eg, city) []: <em>(Enter your city here)</em><br />
Organization Name (eg, company) [Internet Widgits Pty Ltd]: <em(Enter your company name here, or leave blank)</em><br />
Organizational Unit Name (eg, section) []: <em>(OU, if you like. I usually leave it blank)</em><br />
Common Name (eg, YOUR name) []: <em>(The name of your Certificate Authority)</em><br />
Email Address []: <em>(E-Mail Address)</em><br />
nate@example:~/sslca$</code></p>
<p>Let&#8217;s also generate a crl file, which you&#8217;ll need on your gateway boxes:</p>
<p><code>nate@example:~/sslca$ openssl ca -gencrl -out crl.pem</code></p>
<p>You&#8217;ll need to update this CRL file any time you revoke a certificate.</p>
<p>That&#8217;s it, you now have your own certificate authority that you can use to generate certificates.</p>
<p><a name="gencert"><b>Generating a Certificate</b></a><br />
You will need to generate a certificate for every machine that will be making an IPSec connection. This includes the gateway host, and each of your client machines. This section details how to create the certificate, and convert it to formats needed for Windows and such.</p>
<p>Again, we&#8217;ll be using the CA.sh script. Except this time, instead of telling it to create a new Certificate Authority, we&#8217;re telling it to request, then sign a certificate:</p>
<p><code>nate@example:~/sslca$ <em>/usr/lib/ssl/misc/CA.sh -newreq</em><br />
Using configuration from /usr/lib/ssl/openssl.cnf<br />
Generating a 1024 bit RSA private key<br />
...................................+++<br />
...............................+++<br />
writing new private key to 'newreq.pem'<br />
Enter PEM pass phrase: <em>(Enter password to encrypt the new cert's private key with - you'll need this!</em><br />
Verifying password - Enter PEM pass phrase: <em>(repeat password)</em><br />
-----<br />
You are about to be asked to enter information that will be incorporated<br />
into your certificate request.<br />
What you are about to enter is what is called a Distinguished Name or a DN.<br />
There are quite a few fields but you can leave some blank<br />
For some fields there will be a default value,<br />
If you enter '.', the field will be left blank.<br />
-----<br />
Country Name (2 letter code) [AU]: <em>(Country)</em><br />
State or Province Name (full name) [Some-State]: <em>(State)</em><br />
Locality Name (eg, city) []: <em>(City)</em><br />
Organization Name (eg, company) [Internet Widgits Pty Ltd]: <em>(Company)</em><br />
Organizational Unit Name (eg, section) []: <em>(Blank)</em><br />
Common Name (eg, YOUR name) []: <em>("Common Name" -- hostname, username, whatever)</em><br />
Email Address []: <em>(User's email address)</em><br />
Please enter the following 'extra' attributes<br />
to be sent with your certificate request<br />
A challenge password []: <em>(Leave blank)</em><br />
An optional company name []: <em>(Leave blank)</em><br />
Request (and private key) is in newreq.pem</code></p>
<p>What we just did is generate a Certificate Request &#8211; this is the same type of request that you would send to Thawte or Verisign to get a generally-accepted SSL certificate. For our uses, however, we&#8217;ll sign it with our own CA:</p>
<p><code><br />
nate@example:~/sslca$ <em>/usr/lib/ssl/misc/CA.sh -sign</em><br />
Using configuration from /usr/lib/ssl/openssl.cnf<br />
Enter PEM pass phrase:<em>(password you entered when creating the ca)</em><br />
Check that the request matches the signature<br />
<br />
Signature ok<br />
The Subjects Distinguished Name is as follows<br />
countryName           :PRINTABLE:'US'<br />
stateOrProvinceName   :PRINTABLE:'State'<br />
localityName          :PRINTABLE:'City'<br />
organizationName      :PRINTABLE:'ExampleCo'<br />
commonName            :PRINTABLE:'host.example.com'<br />
emailAddress          :IA5STRING:'user@example.com'<br />
Certificate is to be certified until Feb 13 16:28:40 2012 GMT (3650 days)<br />
Sign the certificate? [y/n]:<em>(Press 'y', then enter)</em><br />
<br />
1 out of 1 certificate requests certified, commit? [y/n] <em>(Press 'y', then enter)</em><br />
Write out database with 1 new entries<br />
Data Base Updated<br />
Signed certificate is in newcert.pem</code></p>
<p>Next, move the output files to names that make a bit more sense for future reference.</p>
<p><code>nate@example:~/sslca$ mv newcert.pem host.example.com.pem<br />
nate@example:~/sslca$ mv newreq.pem host.example.com.key</code><br />
<br />
That&#8217;s all that&#8217;s required for Openswan boxes &#8211; you&#8217;ll need these two files, along with the file &#8216;cacert.pem&#8217; from the &#8216;demoCA&#8217; directory, and the &#8216;crl.pem&#8217; file you generated earlier.<br />
If this certificate is needed for a Windows box, you&#8217;ll need to convert it to a p12 format:<br />
<span class="ipsecExample">$ openssl pkcs12 -export -in winhost.example.com.pem -inkey winhost.example.com.key -certfile demoCA/cacert.pem -out winhost.example.com.p12</span></p>
<p><a name="installing"><b>Installing Openswan</b></a><br />
You&#8217;ll need to install Openswan each Linux box you want to speak IPSec. This section covers installing the actual software..</p>
<p>If you are running Debian, there are binary packages available in Sarge and above. For RedHat or Fedora, ATrpms provides binary packages. I can&#8217;t vouch for the quality of these packages, but I do know many people have used them with good success. See <a href="http://atrpms.net">http://atrpms.net</a>. If you want to build it from scratch, you can download it from <a href="http://www.openswan.org/code/">http://www.openswan.org/code</a>, and follow the installation directions included with the package. I recommend the most recent version in the 2.2 series, until 2.3.1 is available &#8211; 2.3.0 has some critical bugs.</p>
<p>You now have two options for which IPSec stack you want to install in the kernel &#8211; you can either use Openswan&#8217;s IPSec stack (KLIPS), or use the built-in IPSec stack in the 2.6 kernel (26sec). If you are running on a stock 2.4 kernel, the only option is KLIPS. You&#8217;ll need to patch NAT Traversal support into your kernel (if you intend to use it), and build the ipsec.o kernel module. Otherwise, if you are using a 2.6 kernel or a 2.4 kernel with backported 26sec support (such as the kernel Debian provides), you don&#8217;t need to touch the kernel-land at all &#8211; you can just install the Openswan user-land utilities and go. With Openswan 2.3.1, we will also have support for KLIPS on 2.6, but without NAT Traversal support (until someone gets around to fixing it!) My current recommendation (and my only tested configuration) is to use a stock kernel, patched with NAT Traversal and with KLIPS added. If you bug me, I&#8217;ll probably provide patched up Debian packages.  :)  I have heard stories about l2tpd not working with the kernel stack.</p>
<p>Once you&#8217;ve selected and set up your IPSec stack and installed the user-land programs, you&#8217;re ready to move on to configuring Openswan.</p>
<p></p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-2600332485776111";
/* 336x280 for wallpapers.php */
google_ad_slot = "8510420182";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p><a name="installgwcert"><b>Installing the Certificate on your Gateway</b></a><br />
This discusses how to install the certificate on your gateway machine. These same steps apply for installing the cert on Openswan clients, too. I&#8217;m assuming you&#8217;ve already created a certificate for each machine (see the &#8220;Generating a Certificate&#8221; section) &#8211; if that&#8217;s not the case, please go back and do that now.</p>
<p>1) Install the files in their proper locations (if installing to a remote machine, please be sure to copy the files in a secure manner): <br />
<span class="ipsecExample"></p>
<p>$ cp /var/sslca/host.example.com.key /etc/ipsec.d/private<br />
$ cp /var/sslca/host.example.com.pem /etc/ipsec.d/certs<br />
$ cp /var/sslca/demoCA/cacert.pem /etc/ipsec.d/cacerts<br />
$ cp /var/sslca/crl.pem /etc/ipsec.d/crls/crl.pem</p>
<p></span><br />
</p>
<p><a name="configgw"><b>Configuring Openswan on the Gateway Machine</b></a></p>
<p>1) Configure ipsec.secrets:<br />
/etc/ipsec.secrets should contain the following:<br />
<span class="ipsecExample"><br />
: RSA host.example.com.key &#8220;password&#8221;</p>
<p></span><br />
The password above should be the password you entered while generating the SSL certificate.</p>
<p>2) Configuring ipsec.conf<br />
/etc/ipsec.conf should look something like the configuration below (note that the indentation is important; without it, openswan will fail):<br />
<span class="ipsecExample"><br />
version 2.0</p>
<p>config setup<br />
	<span class="ipsecTabbedExample">interfaces=%defaultroute</span><br />
	<span class="ipsecTabbedExample">nat_traversal=yes</span><br />
	<span class="ipsecTabbedExample">virtual_private=%v4:10.0.0.0/8,%v4:172.16.0.0/12,%v4:192.168.0.0/16</span></p>
<p>conn %default<br />
        <span class="ipsecTabbedExample">keyingtries=1</span></p>
<p>        <span class="ipsecTabbedExample">compress=yes</span><br />
        <span class="ipsecTabbedExample">disablearrivalcheck=no</span><br />
        <span class="ipsecTabbedExample">authby=rsasig</span><br />
        <span class="ipsecTabbedExample">leftrsasigkey=%cert</span><br />
        <span class="ipsecTabbedExample">rightrsasigkey=%cert</span></p>
<p>conn roadwarrior-net</p>
<p>        <span class="ipsecTabbedExample">leftsubnet=(your_subnet)/(your_netmask)</span><br />
	<span class="ipsecTabbedExample">also=roadwarrior</span></p>
<p>conn roadwarrior-all<br />
        <span class="ipsecTabbedExample">leftsubnet=0.0.0.0/0</span><br />
	<span class="ipsecTabbedExample">also=roadwarrior</span></p>
<p>conn roadwarrior</p>
<p>        <span class="ipsecTabbedExample">left=%defaultroute</span><br />
        <span class="ipsecTabbedExample">leftcert=host.example.com.pem</span><br />
	<span class="ipsecTabbedExample">right=%any</span><br />
	<span class="ipsecTabbedExample">rightsubnet=vhost:%no,%priv</span><br />
        <span class="ipsecTabbedExample">auto=add</span><br />
        <span class="ipsecTabbedExample">pfs=yes</span></p>
<p>conn roadwarrior-l2tp<br />
	<span class="ipsecTabbedExample">type=transport</span><br />
	<span class="ipsecTabbedExample">left=%defaultroute</span><br />
	<span class="ipsecTabbedExample">leftcert=host.example.com.pem</span><br />
	<span class="ipsecTabbedExample">leftprotoport=17/1701</span><br />
	<span class="ipsecTabbedExample">right=%any</span></p>
<p>	<span class="ipsecTabbedExample">rightprotoport=17/1701</span><br />
	<span class="ipsecTabbedExample">pfs=no</span><br />
	<span class="ipsecTabbedExample">auto=add</span></p>
<p>conn roadwarrior-l2tp-oldwin<br />
	<span class="ipsecTabbedExample">left=%defaultroute</span><br />
	<span class="ipsecTabbedExample">leftcert=host.example.com.pem</span></p>
<p>	<span class="ipsecTabbedExample">leftprotoport=17/0</span><br />
	<span class="ipsecTabbedExample">right=%any</span><br />
	<span class="ipsecTabbedExample">rightprotoport=17/1701</span><br />
	<span class="ipsecTabbedExample">rightsubnet=vhost:%no,%priv</span><br />
	<span class="ipsecTabbedExample">pfs=no</span><br />
	<span class="ipsecTabbedExample">auto=add</span></p>
<p>conn block<br />
	<span class="ipsecTabbedExample">auto=ignore</span></p>
<p>conn private<br />
	<span class="ipsecTabbedExample">auto=ignore</span></p>
<p>conn private-or-clear<br />
	<span class="ipsecTabbedExample">auto=ignore</span></p>
<p>conn clear-or-private<br />
	<span class="ipsecTabbedExample">auto=ignore</span></p>
<p>conn clear<br />
	<span class="ipsecTabbedExample">auto=ignore</span></p>
<p>conn packetdefault<br />
	<span class="ipsecTabbedExample">auto=ignore</span></p>
<p></span><br />
The &#8216;roadwarrior-*&#8217; lines allow roadwarriors (IE, regular IPSec clients) to connect to your IPSec gateway itself, the network behind it, and to tunnel all traffic to the &#8216;net at large through it. The roadwarrior-l2tp entries allow both older and newer versions of Windows to connect to an l2tpd daemon running on the same host as your Openswan gateway. Anyone will a valid certificate signed by your CA will be able to connect to your gateway. This configuration also includes NAT Traversal configuration that will allow anyone a host behind a NAT gateway using RFC1918 private addresses (defined in the &#8216;virtual_private&#8217; line) to connect. The &#8216;auto=ignore&#8217; lines are there to disable Opportunistic Encryption, which can cause problems if not configured properly.</p>
<p><a name="configl2tpd"><b>Configuring l2tpd on the Gateway Machine</b></a></p>
<p>1) Install l2tpd. On Debian (assuming you have &#8216;unstable&#8217; in your sources.list), you can just &#8216;apt-get install l2tpd&#8217;; on other distributions, you can find a binary distribution, or grab the source from <a href="http://www.l2tpd.org">http://www.l2tpd.org</a>. If building from source, you proably want to build from the CVS version.</p>
<p>2) Configure l2tpd. On Debian, you&#8217;ll need to edit the file &#8216;/etc/l2tpd/l2tpd.conf&#8217;. Here&#8217;s an example:<br />
<br />
<span class="ipsecExample"><br />
[global]<br />
auth file = /etc/l2tpd/l2tp-secrets<br />
[lns default]<br />
ip range = 192.168.100.240-192.168.100.250<br />
local ip = 192.168.100.254<br />
require chap = yes<br />
refuse pap = yes</p>
<p>require authentication = yes<br />
name = MyVPN<br />
ppp debug = yes<br />
pppoptfile = /etc/ppp/options.l2tpd.lns<br />
length bit = yes<br />
</span><br />
<br />
You&#8217;ll need to change the IP range to a block of unused addresses on your internal network that you would like to hand out to L2TP clients. The &#8216;Local IP&#8217; should be the local IP address of your box. The &#8216;pppoptfile&#8217; specifies which options file to use.</p>
<p>3) Configure your PPP options. From the example above, this is located at /etc/ppp/options.l2tpd.lns.</p>
<p><span class="ipsecExample"><br />
ipcp-accept-local<br />
ipcp-accept-remote<br />
ms-dns  192.168.100.1<br />
ms-wins 192.168.100.1<br />
auth<br />
crtscts<br />
idle 1800<br />
mtu 1200</p>
<p>mru 1200<br />
nodefaultroute<br />
debug<br />
lock<br />
proxyarp<br />
connect-delay 5000<br />
nologfd<br />
</span><br />
<br />
You&#8217;ll need to change ms-dns and ms-wins to match your internal DNS and WINS servers. I&#8217;ve got the MTU set rather low so that packets won&#8217;t be fragmented &#8211; if you leave the MTU at 1500, you may find that things like SMB shares don&#8217;t work properly.</p>
<p>4) Set up your authentication file. This is at /etc/ppp/chap-secrets.</p>
<p><span class="ipsecExample"><br />
# Secrets for authentication using CHAP<br />
# client        server  secret                  IP addresses<br />
username	*       password		*<br />
</span><br />
<br />
You can define multiple users with this method. If it&#8217;s not obvious, &#8216;username&#8217; is the username that will be used for authentication, and &#8216;password&#8217; is the password. If you&#8217;d like to give a user a static IP, you can specify it in the fourth column, &#8216;IP Addresses&#8217;.</p>
<p>That&#8217;s it for the server side! Just start l2tpd with &#8216;/etc/init.d/l2tpd start&#8217;, and you&#8217;re set to go on to the clients.</p>
<p><a name="clientwinxp"><b>Client Setup: Windows XP</b></a></p>
<p>This section covers configuring your Windows XP client to connect to the server with L2TP over IPsec.</p>
<p>First of all, please ensure that Windows XP SP2, or the NAT-Traversal patches are installed. This will help your ability to connect while behind a NAT gateway and such. Also, be sure to be logged in as a user with administrator privileges.</p>
<p>1) The first step is to import a certificate on your Windows box. For sake of simplicity, I&#8217;ll have you import the certificate using Xelerance&#8217;s &#8216;certimport.exe&#8217; tool.</p>
<p>- Download certimport from <a href="ftp://ftp.openswan.org/openswan/windows/certimport/">ftp://ftp.openswan.org/openswan/windows/certimport/</a>, extract it, and install certimport.exe somewhere easy to get at.</p>
<p>- Generate a certificate (as described above) for the box, and save the .p12 format file. Copy this file over to your Windows box in a temporary folder somewhere.<br />
- Import the certificate with:</p>
<p><span class="ipsecExample"><br />
certimport.exe -p password certificate.p12<br />
</span><br />
<br />
2) Set up your L2TP over IPSec connection, as follows.</p>
<p>- Start->Settings->Network Connections<br />
- Create a New Connection</p>
<p>- Connect to the network at my workplace<br />
- Virtual Private Connection<br />
- Company Name: Your VPN Name<br />
- Dial Connection: Yes or no, depending on your needs<br />
- Host Name or IP: Hostname or IP to connect to<br />
- Finish the connection, and go to the properties for it.<br />
- Load the Networking tab<br />
- Change the &#8216;Type&#8217; to &#8216;L2TP IPSec VPN&#8217;<br />
- Save your settings.</p>
<p>- Enter the username and password.</p>
<p>3) Connect! The VPN should come up nicely &#8211; if not, check the Linux side for errors.</p>
<p><a name="clientipsec"><b>Client Setup: Real IPSec Clients</b></a></p>
<p>I&#8217;m just covering setting up L2TP over IPSec connections on this page, but if you would like to set up Openswan or Windows IPSec clients, please see my other page at <a href="http://www.natecarlson.com/linux/ipsec-x509.php">http://www.natecarlson.com/linux/ipsec-x509.php</a>. Note that the server configuration above is alreadty set up to accept normal IPSec connections along with the L2TP connections.</p>
<p><a name="trouble"><b>Some common errors, and resolutions for them</b></a></p>
<p>I&#8217;ll add some common errors as I come by them.</p>
<p><a name="references"><b>References</b></a><br />
Openswan Documentation: <a href="http://www.openswan.org">http://www.openswan.org</a><br />
Jacco de Leeuw&#8217;s Page: <a href="http://www.jacco2.dds.nl/networking/freeswan-l2tp.html">http://www.jacco2.dds.nl/networking/freeswan-l2tp.html</a></p>
<p></p>


<p>Related posts:<ol><li><a href='http://www.natecarlson.com/2007/07/30/configuring-an-ipsec-tunnel-between-openswan-and-windows-2000-xp/' rel='bookmark' title='Permanent Link: Configuring an IPsec tunnel between Openswan and Windows 2000/XP with x509'>Configuring an IPsec tunnel between Openswan and Windows 2000/XP with x509</a></li>
<li><a href='http://www.natecarlson.com/2005/11/22/types-of-vpn-available-under-linux/' rel='bookmark' title='Permanent Link: Types of VPN available on Linux'>Types of VPN available on Linux</a></li>
<li><a href='http://www.natecarlson.com/2005/11/22/apologies-to-people-asking-me-for-help-with-ipsec/' rel='bookmark' title='Permanent Link: apologies to people asking me for help with ipsec'>apologies to people asking me for help with ipsec</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.natecarlson.com/2006/07/10/configuring-an-ipsec-tunnel-with-openswan-and-l2tpd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Types of VPN available on Linux</title>
		<link>http://www.natecarlson.com/2005/11/22/types-of-vpn-available-under-linux/</link>
		<comments>http://www.natecarlson.com/2005/11/22/types-of-vpn-available-under-linux/#comments</comments>
		<pubDate>Tue, 22 Nov 2005 20:32:55 +0000</pubDate>
		<dc:creator>nc</dc:creator>
				<category><![CDATA[VPN]]></category>
		<category><![CDATA[IPsec]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open-source]]></category>
		<category><![CDATA[OpenVPN]]></category>
		<category><![CDATA[PPTP]]></category>

		<guid isPermaLink="false">http://www.natecarlson.com/?p=294</guid>
		<description><![CDATA[Virtual Private Networks, or VPNs, are a way of securely accessing resources on your network from untrusted points on the internet. This page describes some of the various types of open-source VPN solutions that are available on Linux systems, with benefits and drawbacks for each solution. I&#8217;m not making a VPN comparison, per se, but [...]


Related posts:<ol><li><a href='http://www.natecarlson.com/2009/11/02/citrix-to-open-source-xenserver/' rel='bookmark' title='Permanent Link: citrix to open-source xenserver'>citrix to open-source xenserver</a></li>
<li><a href='http://www.natecarlson.com/2006/07/10/configuring-an-ipsec-tunnel-with-openswan-and-l2tpd/' rel='bookmark' title='Permanent Link: Configuring an IPsec tunnel with Openswan and l2tpd'>Configuring an IPsec tunnel with Openswan and l2tpd</a></li>
<li><a href='http://www.natecarlson.com/2005/09/21/tethering-a-sprint-pcs-sanyo-4900-via-usb-with-linux/' rel='bookmark' title='Permanent Link: tethering a sprint pcs sanyo 4900 via usb with linux'>tethering a sprint pcs sanyo 4900 via usb with linux</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p></p><p>Virtual Private Networks, or VPNs, are a way of securely accessing resources on your network from untrusted points on the internet. This page describes some of the various types of open-source VPN solutions that are available on Linux systems, with benefits and drawbacks for each solution. I&#8217;m not making a VPN comparison, per se, but I hope I provide enough information that you can draw your own conclusions, and make a decision on what type of VPN best fits your need. Feel free to mail me (<a href="mailto:ipsec@natecarlson.com">ipsec@natecarlson.com</a>) with any questions.</p>
<p><center><script type="text/javascript"><!--
google_ad_client = "pub-2600332485776111";
/* 336x280 for wallpapers.php */
google_ad_slot = "8510420182";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></center></p>
<p>Contents:<br />
<a href="#ipsec">IPSec VPNs (Openswan, KAME)</a><br />
<a href="#ssl">SSL-Based VPNs (OpenVPN)</a><br />
<a href="#pptp">PPTP-Based VPNs (PoPToP)</a><br />
<a href="#commercial">Commercial VPN software</a></p>
<p><center><!-- You will NOT be able to see the ad on your site! This unit is hidden on your page, and will only display to your search engine traffic (from US and CA). To preview, paste the code up on your site, then add #chitikatest=mortgage to the end of your URL in your browser's address bar.  Example:  www.yourwebsite.com#chitikatest=mortgage. This will show you what the ad would look like to a user who is interested in "mortgages." -->
<script type="text/javascript"><!--
ch_client = "natecarlson";
ch_type = "mpu";
ch_width = 728;
ch_height = 90;
ch_non_contextual = 4;
ch_vertical ="premium";
ch_sid = "Chitika Premium";
var ch_queries = new Array( );
var ch_selected=Math.floor((Math.random()*ch_queries.length));
if ( ch_selected < ch_queries.length ) {
ch_query = ch_queries[ch_selected];
}
//--></script>
<script  src="http://scripts.chitika.net/eminimalls/amm.js" type="text/javascript">
</script></center></p>
<p><a name="ipsec"><b>IPSec VPNs (Openswan, KAME)</b></a></p>
<p>IPSec is one of the older VPN standards, and is still very secure and useful when properly configured. There are two major separate implementations of IPSec under Linux. The first is the project that was originally called FreeS/WAN, but has now forked into <a href="http://www.openswan.org">Openswan</a> and <a href="http://www.strongswan.org">Strongswan</a>. This implementation provides its own IPSec kernel stack, and it can also use the code included in recent kernels. The second is a port of KAME from BSD. KAME can only use the kernel stack. The main IPSec specification itself does not provide a virtual IP for the remote host on the local network, but there are various extensions that offer this. You can also run L2TP over IPSec, which is well supported by Microsoft&#8217;s recent operating systems.</p>
<p>Pros: IPSec is a <em>very</em> established protocol, and is well supported by pretty much anything that supports VPN connections (routers, smartphones, operating systems, you name it!) The Openswan implementation works with the proprietary XAUTH extension, and can work as a client to Cisco, Nortel, and many other VPN concentrators. IPSec makes it reasonably easy to secure what can and cannot go over a tunnel, at the kernel level, without having to set up extra firewall rules. Very flexible for subnet<->subnet configurations, host<->subnet configurations, and so on.</p>
<p>Cons: IPSec can be difficult to get set up and working. It also does not work behind some types of NAT gateways, although this has improved with NAT-Traversal support.</p>
<p>Links:</p>
<p><a href="http://www.openswan.org">Openswan</a><br />
<a href="http://ipsec-tools.sourceforge.net/">IPSec-tools, KAME port for Linux</a><br />
<a href="http://www.natecarlson.com/linux/ipsec-x509.php">My article on configuring Openswan with X.509 and Windows XP&#8217;s client</a><br />
<a href="http://www.natecarlson.com/linux/ipsec-l2tp.php">My article on configuring Openswan with L2TP and Windows XP&#8217;s client</a><br />
<a href="http://www.natecarlson.com/consulting">Consulting information, if you need help</a></p>
<p></p>
<p><a name="ssl"><b>SSL-Based VPNs (OpenVPN)</b></a></p>
<p>Recently, SSL-based VPN have been gaining popularity. The big benefit to SSL VPN&#8217;s is that you only require a single TCP or UDP port to tunnel your traffic on, so you can easily traverse most firewalls. There are many implementations of SSL VPN&#8217;s; many of them are commercial, and support both a web-based interface (which only allows you to browse web pages on the remote network, but works on any browser on any platform.. it is essentially a browser-based proxy server) and a full tunneled implementation. As far as open source implementations go, the most mature by far is <a href="http://www.openvpn.net">OpenVPN</a>. OpenVPN is fairly mature, very feature-rich, and has been ported to most major operating systems. As of yet, there is not a &#8220;clientless&#8221; (ie, web-browser-based) version available that I am aware of.</p>
<p>Pros: Trivial firewall configuration; just needs a single TCP or UDP port. Uses SSL, which is a very mature protocol. Available for most operating systems, including Windows. Flexible configuration options.</p>
<p>Cons: Requires more firewall configuration that IPSec to control access to internal resources. OpenVPN is not supported in most commercial VPN concentrators; however, they usually provide their own implementation.</p>
<p>Links:<br />
<a href="http://www.openvpn.net">OpenVPN&#8217;s home page; very informative.</a></p>
<p></p>
<p><center><script type="text/javascript"><!--
google_ad_client = "pub-2600332485776111";
/* 728x90 page bottom ad */
google_ad_slot = "7834445648";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></center></p>
<p><a name="pptp"><b>PPTP-Based VPNs (PoPToP)</b></a></p>
<p>PPTP is the protocol that Microsoft originally supported somewhere around Windows 95. It&#8217;s been used for a long time, but there are many questions about the security of it. Basically it tunnels a PPP connection over the GRE protocol. PoPToP is the main PPTP server for Linux. If you think you need PPTP, I would highly advise you to look at L2TP over IPSec instead &#8212; L2TP over IPSec is more secure, offers all the same features, plus a few extras.</p>
<p>Pros: Easy configuration under Windows, supported by many commercial routers/firewalls.</p>
<p>Cons: Questionable security, firewall/NAT problems similar to IPSec. Requires kernel patches to offer encryption.</p>
<p>Links:<br />
<a href="http://www.poptop.org/">PoPToP home page.</a><br />
<a href="http://www.schneier.com/paper-pptpv2.html">Analysis of the MSCHAP-v2 protocol</a></p>
<p></p>
<p><!-- You will NOT be able to see the ad on your site! This unit is hidden on your page, and will only display to your search engine traffic (from US and CA). To preview, paste the code up on your site, then add #chitikatest=mortgage to the end of your URL in your browser's address bar.  Example:  www.yourwebsite.com#chitikatest=mortgage. This will show you what the ad would look like to a user who is interested in "mortgages." -->
<script type="text/javascript"><!--
ch_client = "natecarlson";
ch_type = "mpu";
ch_width = 728;
ch_height = 90;
ch_non_contextual = 4;
ch_vertical ="premium";
ch_sid = "Chitika Premium";
var ch_queries = new Array( );
var ch_selected=Math.floor((Math.random()*ch_queries.length));
if ( ch_selected < ch_queries.length ) {
ch_query = ch_queries[ch_selected];
}
//--></script>
<script  src="http://scripts.chitika.net/eminimalls/amm.js" type="text/javascript">
</script></p>
<p><a name="commercial"><b>Commercial VPN software</b></a></p>
<p>There are various commercial VPN clients available for Linux, but as far as I am aware, there are not any commercial servers. If you are aware of any commercial servers for Linux, please let me know. Below is a list of some of the better-known commercial clients.</p>
<p>Links:<br />
<a href="http://www.unix-ag.uni-kl.de/~massar/vpnc/">vpnc</a> &#8212; open-source client to connect to Cisco VPN concentrators with IPsec<br />
<a href="http://www.infradead.org/openconnect.html">OpenConnect</a> &#8212; open-source client to connect to Cisco &#8220;AnyConnect&#8221; SSL VPN&#8217;s<br />
<a href="http://www.cisco.com/en/US/products/sw/secursw/ps2308/products_user_guide_book09186a00802aa59f.html">Cisco Client</a> &#8212; link is to reference manual; if you have a CCO login you can download the client.<br />
<a href="http://www.nortelnetworks.com/products/01/contivity/multi_os/">Nortel VPN Client</a><br />
<a href="http://www.apani.com/vpn-clients/overview">Apani VPN client for Nortel</a></p>


<p>Related posts:<ol><li><a href='http://www.natecarlson.com/2009/11/02/citrix-to-open-source-xenserver/' rel='bookmark' title='Permanent Link: citrix to open-source xenserver'>citrix to open-source xenserver</a></li>
<li><a href='http://www.natecarlson.com/2006/07/10/configuring-an-ipsec-tunnel-with-openswan-and-l2tpd/' rel='bookmark' title='Permanent Link: Configuring an IPsec tunnel with Openswan and l2tpd'>Configuring an IPsec tunnel with Openswan and l2tpd</a></li>
<li><a href='http://www.natecarlson.com/2005/09/21/tethering-a-sprint-pcs-sanyo-4900-via-usb-with-linux/' rel='bookmark' title='Permanent Link: tethering a sprint pcs sanyo 4900 via usb with linux'>tethering a sprint pcs sanyo 4900 via usb with linux</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.natecarlson.com/2005/11/22/types-of-vpn-available-under-linux/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>apologies to people asking me for help with ipsec</title>
		<link>http://www.natecarlson.com/2005/11/22/apologies-to-people-asking-me-for-help-with-ipsec/</link>
		<comments>http://www.natecarlson.com/2005/11/22/apologies-to-people-asking-me-for-help-with-ipsec/#comments</comments>
		<pubDate>Tue, 22 Nov 2005 17:53:18 +0000</pubDate>
		<dc:creator>nc</dc:creator>
				<category><![CDATA[VPN]]></category>
		<category><![CDATA[IPsec]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.natecarlson.com/2005/11/22/apologies-to-people-asking-me-for-help-with-ipsec/</guid>
		<description><![CDATA[Just want to issue a blanket apology to people who have e-mailed me for help with IPSec that I have not had time to respond to &#8211; I&#8217;ve been very busy lately, and unfortunately this has fallen on my priority list somewhat.
I&#8217;ve been considering posting a forum on my site, to help me better track [...]


Related posts:<ol><li><a href='http://www.natecarlson.com/2007/07/30/configuring-an-ipsec-tunnel-between-openswan-and-windows-2000-xp/' rel='bookmark' title='Permanent Link: Configuring an IPsec tunnel between Openswan and Windows 2000/XP with x509'>Configuring an IPsec tunnel between Openswan and Windows 2000/XP with x509</a></li>
<li><a href='http://www.natecarlson.com/2006/07/10/configuring-an-ipsec-tunnel-with-openswan-and-l2tpd/' rel='bookmark' title='Permanent Link: Configuring an IPsec tunnel with Openswan and l2tpd'>Configuring an IPsec tunnel with Openswan and l2tpd</a></li>
<li><a href='http://www.natecarlson.com/2009/01/06/using-procmail-with-plesk/' rel='bookmark' title='Permanent Link: Using Procmail with Plesk'>Using Procmail with Plesk</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p></p><p>Just want to issue a blanket apology to people who have e-mailed me for help with IPSec that I have not had time to respond to &#8211; I&#8217;ve been very busy lately, and unfortunately this has fallen on my priority list somewhat.</p>
<p>I&#8217;ve been considering posting a forum on my site, to help me better track requests for help &#8211; would this be useful to anyone? I&#8217;ve historically preferred the e-mail method, but many people don&#8217;t want to mail the Openswan list for some reason (or don&#8217;t get help there); I&#8217;m thinking that doing forum posts instead may help me get responses back to people who I&#8217;d otherwise miss (since the forum post will sit there forever, while my mailbox gets filled with other clutter.) Feel free to leave a comment and let me know if this would be helpful for you!</p>


<p>Related posts:<ol><li><a href='http://www.natecarlson.com/2007/07/30/configuring-an-ipsec-tunnel-between-openswan-and-windows-2000-xp/' rel='bookmark' title='Permanent Link: Configuring an IPsec tunnel between Openswan and Windows 2000/XP with x509'>Configuring an IPsec tunnel between Openswan and Windows 2000/XP with x509</a></li>
<li><a href='http://www.natecarlson.com/2006/07/10/configuring-an-ipsec-tunnel-with-openswan-and-l2tpd/' rel='bookmark' title='Permanent Link: Configuring an IPsec tunnel with Openswan and l2tpd'>Configuring an IPsec tunnel with Openswan and l2tpd</a></li>
<li><a href='http://www.natecarlson.com/2009/01/06/using-procmail-with-plesk/' rel='bookmark' title='Permanent Link: Using Procmail with Plesk'>Using Procmail with Plesk</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.natecarlson.com/2005/11/22/apologies-to-people-asking-me-for-help-with-ipsec/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>openswan 2.4.0 released</title>
		<link>http://www.natecarlson.com/2005/09/16/openswan-240-released/</link>
		<comments>http://www.natecarlson.com/2005/09/16/openswan-240-released/#comments</comments>
		<pubDate>Fri, 16 Sep 2005 20:03:54 +0000</pubDate>
		<dc:creator>nc</dc:creator>
				<category><![CDATA[VPN]]></category>
		<category><![CDATA[IPsec]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open-source]]></category>

		<guid isPermaLink="false">http://www.natecarlson.com/?p=9</guid>
		<description><![CDATA[Openswan 2.4.0 has been released. Three biggest fixes:

NAT-T support for KLIPS on 2.6 (Sponsored by Astaro)

Additional Cipher support with KLIPS on 2.6 (Sponsored by Astaro)

Fix for NAT-T/PSK rekey (Ulrich @ Astaro)


KLIPS on 2.6 should be big.. once they get it fully working on 2.6.13, I&#8217;ll have to give it a shot.


Related posts:Configuring an IPsec tunnel [...]


Related posts:<ol><li><a href='http://www.natecarlson.com/2006/07/10/configuring-an-ipsec-tunnel-with-openswan-and-l2tpd/' rel='bookmark' title='Permanent Link: Configuring an IPsec tunnel with Openswan and l2tpd'>Configuring an IPsec tunnel with Openswan and l2tpd</a></li>
<li><a href='http://www.natecarlson.com/2008/03/31/xenenterprise-41/' rel='bookmark' title='Permanent Link: xenenterprise 4.1'>xenenterprise 4.1</a></li>
<li><a href='http://www.natecarlson.com/2007/07/30/configuring-an-ipsec-tunnel-between-openswan-and-windows-2000-xp/' rel='bookmark' title='Permanent Link: Configuring an IPsec tunnel between Openswan and Windows 2000/XP with x509'>Configuring an IPsec tunnel between Openswan and Windows 2000/XP with x509</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p></p><p><a href="http://www.openswan.org/code/">Openswan 2.4.0</a> has been released. Three biggest fixes:</p>
<ul>
<li>NAT-T support for KLIPS on 2.6 (Sponsored by Astaro)
</li>
<li>Additional Cipher support with KLIPS on 2.6 (Sponsored by Astaro)
</li>
<li>Fix for NAT-T/PSK rekey (Ulrich @ Astaro)
</li>
</ul>
<p>KLIPS on 2.6 should be big.. once they get it fully working on 2.6.13, I&#8217;ll have to give it a shot.</p>


<p>Related posts:<ol><li><a href='http://www.natecarlson.com/2006/07/10/configuring-an-ipsec-tunnel-with-openswan-and-l2tpd/' rel='bookmark' title='Permanent Link: Configuring an IPsec tunnel with Openswan and l2tpd'>Configuring an IPsec tunnel with Openswan and l2tpd</a></li>
<li><a href='http://www.natecarlson.com/2008/03/31/xenenterprise-41/' rel='bookmark' title='Permanent Link: xenenterprise 4.1'>xenenterprise 4.1</a></li>
<li><a href='http://www.natecarlson.com/2007/07/30/configuring-an-ipsec-tunnel-between-openswan-and-windows-2000-xp/' rel='bookmark' title='Permanent Link: Configuring an IPsec tunnel between Openswan and Windows 2000/XP with x509'>Configuring an IPsec tunnel between Openswan and Windows 2000/XP with x509</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.natecarlson.com/2005/09/16/openswan-240-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using memcached (feed is rejected)
Page Caching using memcached (request URI is rejected)
Database Caching 72/259 queries in 0.570 seconds using memcached

Served from: www.natecarlson.com @ 2010-07-30 12:09:05 -->