<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.osnexus.com/index.php?action=history&amp;feed=atom&amp;title=IPSec</id>
	<title>IPSec - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.osnexus.com/index.php?action=history&amp;feed=atom&amp;title=IPSec"/>
	<link rel="alternate" type="text/html" href="https://wiki.osnexus.com/index.php?title=IPSec&amp;action=history"/>
	<updated>2026-11-19T03:36:50Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://wiki.osnexus.com/index.php?title=IPSec&amp;diff=5490&amp;oldid=prev</id>
		<title>Qadmin: /* Setup */</title>
		<link rel="alternate" type="text/html" href="https://wiki.osnexus.com/index.php?title=IPSec&amp;diff=5490&amp;oldid=prev"/>
		<updated>2015-12-01T18:42:01Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Setup&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 18:42, 1 December 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l26&quot;&gt;Line 26:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 26:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;li&amp;gt;Configure shared key&amp;lt;/li&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;li&amp;gt;Configure shared key&amp;lt;/li&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;The pre-shared key must be the same on both hosts. The pre-shared key is stored in the &amp;lt;b&amp;gt;/etc/ipsec.secrets&amp;lt;/b&amp;gt; file. Our example uses a random string of characters for the key, however you can also use any string. If your string uses spaces, please enclose it in quotes.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The following command will encode some random data which we will use as the shared key.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The following command will encode some random data which we will use as the shared key.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l74&quot;&gt;Line 74:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 76:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;li&amp;gt;Configure shared key&amp;lt;/li&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;li&amp;gt;Configure shared key&amp;lt;/li&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Copy the same &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;line &lt;/del&gt;from the QuantaStor box into &amp;lt;b&amp;gt;/etc/ipsec.secrets&amp;lt;/b&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Copy the same &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pre-shared key definition &lt;/ins&gt;from the QuantaStor box into &amp;lt;b&amp;gt;/etc/ipsec.secrets&amp;lt;/b&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;@qs1.example.net @client1.example.net : PSK 0sEGme37ZWlkZTbaRsiSPVw7/n7QrSqt1a8qvpD704EbjM&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;@qs1.example.net @client1.example.net : PSK 0sEGme37ZWlkZTbaRsiSPVw7/n7QrSqt1a8qvpD704EbjM&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wikidb:diff:1.41:old-5488:rev-5490:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Qadmin</name></author>
	</entry>
	<entry>
		<id>https://wiki.osnexus.com/index.php?title=IPSec&amp;diff=5488&amp;oldid=prev</id>
		<title>Qadmin: Created page with &quot;= Internet Protocol Security (IPsec) =  IPsec can be used in protecting data flows between a pair of hosts (host-to-host), between a pair of security gateways (network-to-netw...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.osnexus.com/index.php?title=IPSec&amp;diff=5488&amp;oldid=prev"/>
		<updated>2015-12-01T18:33:21Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;= Internet Protocol Security (IPsec) =  IPsec can be used in protecting data flows between a pair of hosts (host-to-host), between a pair of security gateways (network-to-netw...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Internet Protocol Security (IPsec) =&lt;br /&gt;
&lt;br /&gt;
IPsec can be used in protecting data flows between a pair of hosts (host-to-host), between a pair of security gateways (network-to-network), or between a security gateway and a host (network-to-host). [https://en.wikipedia.org/wiki/IPsec wikipedia]&lt;br /&gt;
&lt;br /&gt;
== Host to Host Example ==&lt;br /&gt;
&lt;br /&gt;
In this example we will use a pre-shared key to encrypt traffic between two hosts.&lt;br /&gt;
&lt;br /&gt;
 QuantaStor System&lt;br /&gt;
 Name: qs1.example.net&lt;br /&gt;
 Address: 192.168.0.2&lt;br /&gt;
&lt;br /&gt;
 Ubuntu Client&lt;br /&gt;
 Name: client1.example.net&lt;br /&gt;
 Address: 192.168.0.3&lt;br /&gt;
&lt;br /&gt;
=== Setup ===&lt;br /&gt;
&lt;br /&gt;
Here are the steps that need to be run on the QuantaStor system as root&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install [https://www.strongswan.org strongSwan]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt-get update&lt;br /&gt;
apt-get install strongswan&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Configure shared key&amp;lt;/li&amp;gt;&lt;br /&gt;
The following command will encode some random data which we will use as the shared key.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo `dd if=/dev/urandom bs=33 count=1 2&amp;gt; /dev/null | base64 -w0`&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The output should look something like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
EGme37ZWlkZTbaRsiSPVw7/n7QrSqt1a8qvpD704EbjM&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Add the following line to the &amp;lt;b&amp;gt;/etc/ipsec.secrets&amp;lt;/b&amp;gt; file. Be sure to use your own key, not this example. Notice that &amp;lt;b&amp;gt;0s&amp;lt;/b&amp;gt; is prepended to the shared key, this indicates the data is base64 encoded.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@qs1.example.net @client1.example.net : PSK 0sEGme37ZWlkZTbaRsiSPVw7/n7QrSqt1a8qvpD704EbjM&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Configure strongSwan&amp;lt;/li&amp;gt;&lt;br /&gt;
Add the following lines to &amp;lt;b&amp;gt;/etc/ipsec.conf&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
conn %default&lt;br /&gt;
        ikelifetime=60m&lt;br /&gt;
        keylife=20m&lt;br /&gt;
        rekeymargin=3m&lt;br /&gt;
        keyingtries=1&lt;br /&gt;
        mobike=no&lt;br /&gt;
        keyexchange=ikev2&lt;br /&gt;
&lt;br /&gt;
conn qs-client1&lt;br /&gt;
        authby=secret&lt;br /&gt;
        left=192.168.0.2&lt;br /&gt;
        leftid=@qs1.example.net&lt;br /&gt;
        leftfirewall=yes&lt;br /&gt;
        right=192.168.0.3&lt;br /&gt;
        rightid=@client1.example.net&lt;br /&gt;
        type=transport&lt;br /&gt;
        auto=start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Restart strongSwan&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
service ipsec restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here are the steps that need to be run on the client box as root&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install [https://www.strongswan.org strongSwan]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt-get update&lt;br /&gt;
apt-get install strongswan&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Configure shared key&amp;lt;/li&amp;gt;&lt;br /&gt;
Copy the same line from the QuantaStor box into &amp;lt;b&amp;gt;/etc/ipsec.secrets&amp;lt;/b&amp;gt;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@qs1.example.net @client1.example.net : PSK 0sEGme37ZWlkZTbaRsiSPVw7/n7QrSqt1a8qvpD704EbjM&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Configure strongSwan&amp;lt;/li&amp;gt;&lt;br /&gt;
Add the following lines to &amp;lt;b&amp;gt;/etc/ipsec.conf&amp;lt;/b&amp;gt;. Note, the only change from the QuantaStor config is the &amp;lt;b&amp;gt;left&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;right&amp;lt;/b&amp;gt; settings are swapped.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
conn %default&lt;br /&gt;
        ikelifetime=60m&lt;br /&gt;
        keylife=20m&lt;br /&gt;
        rekeymargin=3m&lt;br /&gt;
        keyingtries=1&lt;br /&gt;
        mobike=no&lt;br /&gt;
        keyexchange=ikev2&lt;br /&gt;
&lt;br /&gt;
conn qs-client1&lt;br /&gt;
        authby=secret&lt;br /&gt;
        left=192.168.0.3&lt;br /&gt;
        leftid=@client1.example.net&lt;br /&gt;
        leftfirewall=yes&lt;br /&gt;
        right=192.168.0.2&lt;br /&gt;
        rightid=@qs1.example.net&lt;br /&gt;
        type=transport&lt;br /&gt;
        auto=start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Restart strongSwan&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
service ipsec restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start the connection, this can be run from either system.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ipsec up qs-client1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
At this point all traffic between the two hosts will be encrypted. You can check the status of the connection by running &amp;lt;b&amp;gt;ipsec status&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root@qs1:~# ipsec status&lt;br /&gt;
Security Associations:&lt;br /&gt;
   qs-client1[22]: ESTABLISHED 34 minutes ago, 192.168.0.3[client1.example.net]...192.168.0.2[qs1.example.net]&lt;br /&gt;
   qs-client1{22}:  INSTALLED, TRANSPORT, ESP SPIs: c810bccf_i c23fb4e7_o&lt;br /&gt;
   qs-client1{22}:   192.168.0.3/32 === 192.168.0.2/32 &lt;br /&gt;
   qs-client1{23}:  INSTALLED, TRANSPORT, ESP SPIs: c551892c_i c4a28aac_o&lt;br /&gt;
   qs-client1{23}:   192.168.0.3/32 === 192.168.0.2/32 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Qadmin</name></author>
	</entry>
</feed>