<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://leo.leung.xyz/wiki/index.php?action=history&amp;feed=atom&amp;title=StrongSwan</id>
	<title>StrongSwan - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://leo.leung.xyz/wiki/index.php?action=history&amp;feed=atom&amp;title=StrongSwan"/>
	<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=StrongSwan&amp;action=history"/>
	<updated>2026-10-14T11:49:54Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=StrongSwan&amp;diff=4975&amp;oldid=prev</id>
		<title>Leo: Added categories</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=StrongSwan&amp;diff=4975&amp;oldid=prev"/>
		<updated>2020-06-14T23:42:23Z</updated>

		<summary type="html">&lt;p&gt;Added categories&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 23:42, 14 June 2020&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-l76&quot;&gt;Line 76:&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;=== Site B ===&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;=== Site B ===&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;Similar to Site A, but with the IPs for A and B swapped.&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;Similar to Site A, but with the IPs for A and B swapped.&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 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;{{Navbox Linux}}[[Category:Linux]]&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;[[Category:LinuxUtilities]]&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;[[Category:Networking]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki:diff:1.41:old-4073:rev-4975:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Leo</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=StrongSwan&amp;diff=4073&amp;oldid=prev</id>
		<title>Leo: Created page with &quot;StrongSwan is an opensource IPsec implementation and can be used as a site-to-site VPN.  == Installation == Assuming that we have the following sites: * Site A: 3.15.161.169,...&quot;</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=StrongSwan&amp;diff=4073&amp;oldid=prev"/>
		<updated>2019-11-02T21:17:49Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;StrongSwan is an opensource IPsec implementation and can be used as a site-to-site VPN.  == Installation == Assuming that we have the following sites: * Site A: 3.15.161.169,...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;StrongSwan is an opensource IPsec implementation and can be used as a site-to-site VPN.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
Assuming that we have the following sites:&lt;br /&gt;
* Site A: 3.15.161.169,  192.168.1.0/24&lt;br /&gt;
* Site B: 107.189.11.145, 192.168.2.0/24&lt;br /&gt;
&lt;br /&gt;
=== All Sites ===&lt;br /&gt;
On all sites running CentOS 8, install and enable the EPEL repo and then install the StrongSwan package.&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# yum -y install epel-release&lt;br /&gt;
# yum -y install strongswan&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Allow IP forward and disable redirects:&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# cat &amp;gt;&amp;gt; /etc/sysctl.conf  &amp;lt;&amp;lt;EOF&lt;br /&gt;
net.ipv4.ip_forward = 1&lt;br /&gt;
net.ipv4.conf.all.accept_redirects = 0&lt;br /&gt;
net.ipv4.conf.all.send_redirects = 0&lt;br /&gt;
EOF&lt;br /&gt;
# sysctl -p /etc/sysctl.conf&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
All StrongSwan configs are located in {{code|/etc/strongswan/}}. There are two important files to configure: &lt;br /&gt;
# {{code|ipsec.conf}} contains each remote site&amp;#039;s configuration and &lt;br /&gt;
# {{code|ipsec.secrets}} contains pre-shared secrets for each remote site.&lt;br /&gt;
&lt;br /&gt;
A pre-shared secret for each site can be created with {{code|openssl}}:&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
openssl rand -base64 64 | tr -d &amp;quot;\r\n=&amp;quot;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Site A ===&lt;br /&gt;
&lt;br /&gt;
On Site A, configure:&lt;br /&gt;
&lt;br /&gt;
{{code|/etc/strongswan/ipsec.secrets}}:&lt;br /&gt;
{{highlight|lang=text|filename=/etc/strongswan/ipsec.secrets|code=&lt;br /&gt;
# source        destination&lt;br /&gt;
3.15.161.169    107.189.11.145 : PSK &amp;quot;secret&amp;quot;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{code|/etc/strongswan/ipsec.conf}}:&lt;br /&gt;
{{highlight|lang=text|filename=/etc/strongswan/ipsec.conf|code=&lt;br /&gt;
# basic configuration&lt;br /&gt;
config setup&lt;br /&gt;
	charondebug=&amp;quot;all&amp;quot;&lt;br /&gt;
	uniqueids=yes&lt;br /&gt;
	strictcrlpolicy=no&lt;br /&gt;
&lt;br /&gt;
# connection to site B&lt;br /&gt;
conn A-to-B&lt;br /&gt;
	authby=secret&lt;br /&gt;
	left=%defaultroute&lt;br /&gt;
	leftid=3.15.161.169&lt;br /&gt;
	leftsubnet=192.168.1.0/24&lt;br /&gt;
	right=107.189.11.145&lt;br /&gt;
	rightsubnet=192.168.2.0/24&lt;br /&gt;
	ike=aes256-sha2_256-modp1024!&lt;br /&gt;
	esp=aes256-sha2_256!&lt;br /&gt;
	keyingtries=0&lt;br /&gt;
	ikelifetime=1h&lt;br /&gt;
	lifetime=8h&lt;br /&gt;
	dpddelay=30&lt;br /&gt;
	dpdtimeout=120&lt;br /&gt;
	dpdaction=restart&lt;br /&gt;
	auto=start&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Masquerade traffic destined to this site from the remote site:&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -d 192.168.1.0/24 -j MASQUERADE&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Site B ===&lt;br /&gt;
Similar to Site A, but with the IPs for A and B swapped.&lt;/div&gt;</summary>
		<author><name>Leo</name></author>
	</entry>
</feed>