<?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>pfSense &#8211; Blog of Kliment Andreev &#8211; A place so I won&#039;t forget things</title>
	<atom:link href="https://blog.andreev.it/category/pfsense/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.andreev.it</link>
	<description></description>
	<lastBuildDate>Tue, 03 Nov 2020 13:51:31 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>FreeBSD, pfSense: Site-to-site VPN IPsec tunnel between FreeBSD and pfSense using strongswan</title>
		<link>https://blog.andreev.it/2020/08/freebsd-pfsense-site-to-site-vpn-ipsec-tunnel-between-freebsd-and-pfsense-using-strongswan/</link>
					<comments>https://blog.andreev.it/2020/08/freebsd-pfsense-site-to-site-vpn-ipsec-tunnel-between-freebsd-and-pfsense-using-strongswan/#respond</comments>
		
		<dc:creator><![CDATA[Kliment Andreev]]></dc:creator>
		<pubDate>Fri, 28 Aug 2020 20:49:59 +0000</pubDate>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[pfSense]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[IPSec]]></category>
		<category><![CDATA[strongswan]]></category>
		<guid isPermaLink="false">https://blog.andreev.it/?p=6991</guid>

					<description><![CDATA[I have written a lot about pfSense and different types of VPN scenarios (AWS,&#8230;]]></description>
										<content:encoded><![CDATA[<div id="bsf_rt_marker"></div><p>I have written a lot about pfSense and different types of VPN scenarios (AWS, Azure), but never created a post about a site-to-site VPN tunnel with FreeBSD running strongswan and pfSense. The scenario described here works with FreeBSD, but it will work with any other Linux distribution with some small OS dependand changes. The syntax for strongswan is the same, it’s just the configuration file names and locations that are different across distributions. For CentOS, see my other <a href="https://blog.andreev.it/?p=4701" rel="noopener noreferrer" target="_blank">post</a>.</p>
<h1>Prerequisites</h1>
<p>Both the pfSense box and FreeBSD need to have public IPs. While it&#8217;s possible to have them behind NAT, this scenario only covers configurations with public IPs. You should disable the firewall on FreeBSD. Both of pfSense and FreeBSD box need two network interfaces. In my case this is how it looks like.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2020/08/P150-01.png"><img fetchpriority="high" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2020/08/P150-01.png" alt="" width="337" height="559" class="aligncenter size-full wp-image-6995" srcset="https://blog.andreev.it/wp-content/uploads/2020/08/P150-01.png 337w, https://blog.andreev.it/wp-content/uploads/2020/08/P150-01-181x300.png 181w" sizes="(max-width: 337px) 100vw, 337px" /></a><br />
It&#8217;s much easier if you enter these values in a small spreadsheet so you don&#8217;t get confused later.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2020/08/P150-02.jpg"><img decoding="async" src="https://blog.andreev.it/wp-content/uploads/2020/08/P150-02.jpg" alt="" width="716" height="198" class="aligncenter size-full wp-image-6996" /></a></p>
<h1>FreeBSD configuration</h1>
<p>First, we have to install strongswan, configure the 2nd internal NIC if it&#8217;s not configured and allow FreeBSD to act as a gateway for other servers behind it (e.g. servers srv1 and srv2).<br />
Install strongswan from packages.</p>
<pre class="brush: bash; title: ; notranslate">
pkg install strongswan
</pre>
<p>Edit <strong>/etc/rc.conf</strong> and add this line, so strongswan starts on boot.</p>
<pre class="brush: bash; title: ; notranslate">
strongswan_enable=&quot;YES&quot;
</pre>
<p>While editing that file, add this line too.</p>
<pre class="brush: bash; title: ; notranslate">
gateway_enable=&quot;YES&quot;
</pre>
<p>&#8230;and if your internal NIC is not configured, you can assign the IP there too.</p>
<pre class="brush: bash; title: ; notranslate">
ifconfig_vtnet1=&quot;inet 10.39.96.3 netmask 255.255.240.0&quot;
</pre>
<p>where <strong>vtnet1 </strong>is the name of the NIC. You can see the name of your NIC by doing <strong>ifconfig -a</strong>.<br />
Next, we&#8217;ll configure strongswan. The config files are under <strong>/usr/local/etc.</strong> Edit <strong>ipsec.conf</strong> and delete everything then paste these lines. </p>
<pre class="brush: bash; highlight: [13,14,15,17,18,19]; title: ; notranslate">
config setup
 
conn %default
        ikelifetime=60m
        keylife=20m
        rekeymargin=3m
        keyingtries=1
        authby=secret
        keyexchange=ikev2
        mobike=no
 
conn net-net
        left=140.82.31.124
        leftsubnet=10.39.96.0/20
        leftid=140.82.31.124
        leftfirewall=no
        right=67.81.194.50
        rightsubnet=192.168.1.0/24
        rightid=67.81.194.50
        ike=aes256-sha256-modp2048!
        esp=aes256-sha256!
        auto=start
        lifetime=1h
</pre>
<p>If you look at <strong>lines 13, 14</strong> and <strong>15 </strong>you&#8217;ll see that <strong>line 13</strong> is the external IP of our FreeBSD box, <strong>line 14</strong> is the internal subnet for FreeBSD and <strong>line 15</strong> is just a description for this connection. In my case I used the IP. The same applies for <strong>lines 17, 18</strong> and <strong>19</strong>. <strong>Line 17</strong> is the external IP of the pfSense, <strong>line 18 </strong>is the internal subnet for the resources behind pfSense and <strong>line 19</strong> is just an ID for this connection.<br />
<strong>NOTE:</strong> if you change the IDs, e.g. <strong>lines 15</strong> and <strong>19</strong>, then you have to change the same in the secrets file.<br />
The secrets file is a password that will be used to communicate between FreeBSD and pfSense. Another option is to use certificates and it&#8217;s not that difficult to reconfigure that, but that&#8217;s not in this scope. So, edit <strong>/usr/local/etc/ipsec.secrets</strong> and add this line.</p>
<pre class="brush: bash; title: ; notranslate">
140.82.31.124 67.81.194.50 : PSK &quot;supersecretpassword&quot;
</pre>
<p>Don&#8217;t use tabs. Spaces only or it won&#8217;t work. As you can see you are specifying the <strong>leftid</strong>, then the <strong>rightid </strong>and some password. <strong>PSK </strong>means <strong>pre-shared key</strong> or password. The parameter <strong>leftid </strong>and <strong>rightid </strong>in <strong>ipsec.conf</strong> must be the same with the parameters here. So, if I change the <strong>line 14</strong> to be <strong>leftid=@freebsd</strong>, I have to do the same in <strong>ipsec.secrets</strong>. I have to specify<strong> @freebsd</strong> instead of <strong>140.82.31.124</strong>. </p>
<h1>pfSense</h1>
<p>Now that the FreeBSD strongswan box is configured, we can configure pfSense. In pfSense, go to <strong>VPN | IPSec</strong> from the menu and click on <strong>Add P1</strong> button. Fill out the <strong>General Information section</strong>, so it looks like this.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2020/08/P150-03.jpg"><img decoding="async" src="https://blog.andreev.it/wp-content/uploads/2020/08/P150-03.jpg" alt="" width="1166" height="442" class="aligncenter size-full wp-image-7007" srcset="https://blog.andreev.it/wp-content/uploads/2020/08/P150-03.jpg 1166w, https://blog.andreev.it/wp-content/uploads/2020/08/P150-03-300x114.jpg 300w, https://blog.andreev.it/wp-content/uploads/2020/08/P150-03-1024x388.jpg 1024w, https://blog.andreev.it/wp-content/uploads/2020/08/P150-03-768x291.jpg 768w, https://blog.andreev.it/wp-content/uploads/2020/08/P150-03-585x222.jpg 585w" sizes="(max-width: 1166px) 100vw, 1166px" /></a><br />
As you can see, we use <strong>IKEv2 </strong>and our remote gateway is <strong>140.82.31.124</strong> which is the FreeBSD strongswan box.<br />
For <strong>Phase 1 Proposal (Authentication and Algorithms)</strong>, fill out the section so it looks like this. The <strong>Pre-Shared Key</strong> is what you put in <strong>/usr/local/etc/ipsec.secrets</strong> file, remember?<br />
<a href="https://blog.andreev.it/wp-content/uploads/2020/08/P150-04.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2020/08/P150-04.jpg" alt="" width="1164" height="274" class="aligncenter size-full wp-image-7010" srcset="https://blog.andreev.it/wp-content/uploads/2020/08/P150-04.jpg 1164w, https://blog.andreev.it/wp-content/uploads/2020/08/P150-04-300x71.jpg 300w, https://blog.andreev.it/wp-content/uploads/2020/08/P150-04-1024x241.jpg 1024w, https://blog.andreev.it/wp-content/uploads/2020/08/P150-04-768x181.jpg 768w, https://blog.andreev.it/wp-content/uploads/2020/08/P150-04-585x138.jpg 585w" sizes="(max-width: 1164px) 100vw, 1164px" /></a><br />
Then for <strong>Phase 1 Proposal (Algorithms)</strong>, use these values. If you look at your <strong>ipsec.conf</strong>, you&#8217;ll see how they match.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2020/08/P150-05.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2020/08/P150-05.jpg" alt="" width="1165" height="280" class="aligncenter size-full wp-image-7021" srcset="https://blog.andreev.it/wp-content/uploads/2020/08/P150-05.jpg 1165w, https://blog.andreev.it/wp-content/uploads/2020/08/P150-05-300x72.jpg 300w, https://blog.andreev.it/wp-content/uploads/2020/08/P150-05-1024x246.jpg 1024w, https://blog.andreev.it/wp-content/uploads/2020/08/P150-05-768x185.jpg 768w, https://blog.andreev.it/wp-content/uploads/2020/08/P150-05-585x141.jpg 585w" sizes="(max-width: 1165px) 100vw, 1165px" /></a><br />
&#8230;and use the defaults for the <strong>Advanced Options</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2020/08/P150-06.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2020/08/P150-06.jpg" alt="" width="1151" height="486" class="aligncenter size-full wp-image-7013" srcset="https://blog.andreev.it/wp-content/uploads/2020/08/P150-06.jpg 1151w, https://blog.andreev.it/wp-content/uploads/2020/08/P150-06-300x127.jpg 300w, https://blog.andreev.it/wp-content/uploads/2020/08/P150-06-1024x432.jpg 1024w, https://blog.andreev.it/wp-content/uploads/2020/08/P150-06-768x324.jpg 768w, https://blog.andreev.it/wp-content/uploads/2020/08/P150-06-585x247.jpg 585w" sizes="(max-width: 1151px) 100vw, 1151px" /></a><br />
Once you click <strong>Save </strong>at the bottom, pfSense will bring you back. Just click <strong>Apply Changes</strong>.<br />
Do the phase 2 now, click on <strong>Show Phase 2 Entries</strong> and then click <strong>Add P2</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2020/08/P150-07.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2020/08/P150-07.jpg" alt="" width="1168" height="119" class="aligncenter size-full wp-image-7014" srcset="https://blog.andreev.it/wp-content/uploads/2020/08/P150-07.jpg 1168w, https://blog.andreev.it/wp-content/uploads/2020/08/P150-07-300x31.jpg 300w, https://blog.andreev.it/wp-content/uploads/2020/08/P150-07-1024x104.jpg 1024w, https://blog.andreev.it/wp-content/uploads/2020/08/P150-07-768x78.jpg 768w, https://blog.andreev.it/wp-content/uploads/2020/08/P150-07-585x60.jpg 585w" sizes="(max-width: 1168px) 100vw, 1168px" /></a><br />
For the phase 2, enter the following information. Choose <strong>Network </strong>instead of <strong>LAN </strong>and add the subnets for both pfSense and FreeBSD. In my case it looks like this. Phase 2 is very important because you have to make sure you enter the proper values. One extra checkmark and you&#8217;ll be endlessly troubleshooting why it&#8217;s not working. So, pay attention please!<br />
<a href="https://blog.andreev.it/wp-content/uploads/2020/08/P150-08.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2020/08/P150-08.jpg" alt="" width="1158" height="430" class="aligncenter size-full wp-image-7015" srcset="https://blog.andreev.it/wp-content/uploads/2020/08/P150-08.jpg 1158w, https://blog.andreev.it/wp-content/uploads/2020/08/P150-08-300x111.jpg 300w, https://blog.andreev.it/wp-content/uploads/2020/08/P150-08-1024x380.jpg 1024w, https://blog.andreev.it/wp-content/uploads/2020/08/P150-08-768x285.jpg 768w, https://blog.andreev.it/wp-content/uploads/2020/08/P150-08-585x217.jpg 585w" sizes="(max-width: 1158px) 100vw, 1158px" /></a><br />
For the <strong>Phase 2 Proposal (SA/Key Exchange)</strong> i have <strong>AES 256 bit</strong> instead of <strong>Auto </strong>and <strong>SHA256 </strong>instead of <strong>SHA1</strong>. <strong>Lifetime </strong>is also 3600.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2020/08/P150-09.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2020/08/P150-09.jpg" alt="" width="1165" height="632" class="aligncenter size-full wp-image-7016" srcset="https://blog.andreev.it/wp-content/uploads/2020/08/P150-09.jpg 1165w, https://blog.andreev.it/wp-content/uploads/2020/08/P150-09-300x163.jpg 300w, https://blog.andreev.it/wp-content/uploads/2020/08/P150-09-1024x556.jpg 1024w, https://blog.andreev.it/wp-content/uploads/2020/08/P150-09-768x417.jpg 768w, https://blog.andreev.it/wp-content/uploads/2020/08/P150-09-585x317.jpg 585w" sizes="(max-width: 1165px) 100vw, 1165px" /></a><br />
And you can leave the <strong>Advanced Configuration</strong> as is. If you notice that your tunnel drops because there is 0 activity, you can enter the IP address of the FreeBSD box or an IP for a server that&#8217;s behind FreeBSD. This will send ping ICMP packets to the destination so it keeps the tunnel alive. It&#8217;s not necessary, but you never know. Click <strong>Save</strong> then <strong>Apply Changes</strong> again.<br />
By default, pfSense will block the IPsec traffic, so you have to enable it. From the menu go to <strong>Firewall | Rules</strong> and click on <strong>IPSec </strong>submenu. Click <strong>Add </strong>and fill out the form so it looks like this.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2020/08/P150-10.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2020/08/P150-10.png" alt="" width="1156" height="429" class="aligncenter size-full wp-image-7017" srcset="https://blog.andreev.it/wp-content/uploads/2020/08/P150-10.png 1156w, https://blog.andreev.it/wp-content/uploads/2020/08/P150-10-300x111.png 300w, https://blog.andreev.it/wp-content/uploads/2020/08/P150-10-1024x380.png 1024w, https://blog.andreev.it/wp-content/uploads/2020/08/P150-10-768x285.png 768w, https://blog.andreev.it/wp-content/uploads/2020/08/P150-10-585x217.png 585w" sizes="(max-width: 1156px) 100vw, 1156px" /></a><br />
…and this.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2020/08/P150-11.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2020/08/P150-11.png" alt="" width="1157" height="442" class="aligncenter size-full wp-image-7018" srcset="https://blog.andreev.it/wp-content/uploads/2020/08/P150-11.png 1157w, https://blog.andreev.it/wp-content/uploads/2020/08/P150-11-300x115.png 300w, https://blog.andreev.it/wp-content/uploads/2020/08/P150-11-1024x391.png 1024w, https://blog.andreev.it/wp-content/uploads/2020/08/P150-11-768x293.png 768w, https://blog.andreev.it/wp-content/uploads/2020/08/P150-11-585x223.png 585w" sizes="(max-width: 1157px) 100vw, 1157px" /></a><br />
Click <strong>Save </strong>and go back to the FreeBSD box. Reboot the FreeBSD.</p>
<h1>Site-to-site VPN tunnel</h1>
<p>Once FreeBSD comes back up, do:</p>
<pre class="brush: bash; highlight: [1]; title: ; notranslate">
ipsec status
Security Associations (1 up, 0 connecting):
     net-net&#x5B;1]: ESTABLISHED 8 seconds ago, 140.82.31.124&#x5B;140.82.31.124]...67.81.194.50&#x5B;67.81.194.50]
     net-net{1}:  INSTALLED, TUNNEL, reqid 1, ESP SPIs: ca009d9e_i cc8a8b76_o
     net-net{1}:   10.39.96.0/20 === 192.168.1.0/24
</pre>
<p>&#8230;and if you go to pfSense, under <strong>Status | IPsec</strong> you can see the tunnel established.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2020/08/P150-12.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2020/08/P150-12.jpg" alt="" width="1138" height="229" class="aligncenter size-full wp-image-7023" srcset="https://blog.andreev.it/wp-content/uploads/2020/08/P150-12.jpg 1138w, https://blog.andreev.it/wp-content/uploads/2020/08/P150-12-300x60.jpg 300w, https://blog.andreev.it/wp-content/uploads/2020/08/P150-12-1024x206.jpg 1024w, https://blog.andreev.it/wp-content/uploads/2020/08/P150-12-768x155.jpg 768w, https://blog.andreev.it/wp-content/uploads/2020/08/P150-12-585x118.jpg 585w" sizes="(max-width: 1138px) 100vw, 1138px" /></a><br />
If you try to ping the FreeBSD from a server behind your pfSense, you&#8217;ll get a response. But if you try to ping something behind pfSense from the FreeBSD box, it won&#8217;t work.<br />
Check the routes in FreeBSD. </p>
<pre class="brush: bash; highlight: [1]; title: ; notranslate">
netstat -nr | grep 192
192.168.1.0/24     140.82.30.1        US       vtnet0
</pre>
<p>This is a wrong route that strongswan injected. Delete the route and add the proper one.</p>
<pre class="brush: bash; highlight: [1,3]; title: ; notranslate">
route delete 192.168.1.0
delete net 192.168.1.0
route add -net 192.168.1.0/24 10.39.96.3
add net 192.168.1.0: gateway 10.39.96.3
</pre>
<p>Now if you ping something, it will work. But wait! Once we reboot, everything will be messed up again? Correct!<br />
First, add this line in <strong>/etc/rc.conf</strong>. It creates a permanent static route.</p>
<pre class="brush: bash; title: ; notranslate">
route_vpn=&quot;-net 192.168.1.0/24 10.39.96.3&quot;
</pre>
<p>Second, prevent strongswan to mess up with the routes. Edit <strong>/usr/local/etc/strongswan.conf</strong> and above line <strong>load_modular = yes</strong>, add <strong>install_routes = no</strong>. It looks like this.</p>
<pre class="brush: bash; title: ; notranslate">
......
charon {
        install_routes = no
        load_modular = yes
        plugins {
                include strongswan.d/charon/*.conf
        }
}
......
</pre>
<p>After this change, restart strongswan.</p>
<pre class="brush: bash; title: ; notranslate">
service strongswan restart
</pre>
<p><strong>NOTE</strong>: For any resource behind FreeBSD, you have to add a static route for the 192.168.1.0/24 network. For example, for Windows type <strong>route add 192.168.1.0/24 10.39.96.3 -p</strong> otherwise that resource will use the default gateway. </p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.andreev.it/2020/08/freebsd-pfsense-site-to-site-vpn-ipsec-tunnel-between-freebsd-and-pfsense-using-strongswan/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>CentOS, pfSense: Site-to-site VPN tunnel with strongswan and pfSense</title>
		<link>https://blog.andreev.it/2019/03/150-centos-pfsense-site-to-site-vpn-tunnel-with-strongswan-and-pfsense/</link>
					<comments>https://blog.andreev.it/2019/03/150-centos-pfsense-site-to-site-vpn-tunnel-with-strongswan-and-pfsense/#comments</comments>
		
		<dc:creator><![CDATA[Kliment Andreev]]></dc:creator>
		<pubDate>Sat, 09 Mar 2019 20:32:16 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[pfSense]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[strongswan]]></category>
		<category><![CDATA[VPN]]></category>
		<guid isPermaLink="false">https://blog.andreev.it/?p=4701</guid>

					<description><![CDATA[I have written a lot about pfSense and different types of VPN scenarios (AWS,&#8230;]]></description>
										<content:encoded><![CDATA[<div id="bsf_rt_marker"></div><p>I have written a lot about pfSense and different types of VPN scenarios (AWS, Azure), but never created a post about a site-to-site VPN tunnel with CentOS running strongswan and pfSense. The scenario described here works with CentOS, but it will work with any other Linux of BSD distribution. The syntax for strongswan is the same, it&#8217;s just the configuration file names and locations that are different across distributions. </p>
<h1>Prerequisites</h1>
<p>Both the pfSense box and CentOS need to have public IPs. While it&#8217;s possible to have them behind NAT, this scenario only covers configurations with public IPs. You should disable the firewalld on CentOS (initially). Both of them need two network interfaces. In my case this is how it looks like.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2019/03/P127-01.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2019/03/P127-01.jpg" alt="" width="896" height="532" class="aligncenter size-full wp-image-8464" srcset="https://blog.andreev.it/wp-content/uploads/2019/03/P127-01.jpg 896w, https://blog.andreev.it/wp-content/uploads/2019/03/P127-01-300x178.jpg 300w, https://blog.andreev.it/wp-content/uploads/2019/03/P127-01-768x456.jpg 768w, https://blog.andreev.it/wp-content/uploads/2019/03/P127-01-585x347.jpg 585w" sizes="(max-width: 896px) 100vw, 896px" /></a><br />
It&#8217;s also easier if you create a small spreadsheet so you don&#8217;t loose track of the IPs and subnets.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2019/03/P127-02.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2019/03/P127-02.png" alt="" width="396" height="89" class="aligncenter size-full wp-image-8465" srcset="https://blog.andreev.it/wp-content/uploads/2019/03/P127-02.png 396w, https://blog.andreev.it/wp-content/uploads/2019/03/P127-02-300x67.png 300w" sizes="(max-width: 396px) 100vw, 396px" /></a></p>
<h1>CentOS configuration</h1>
<p>I am using CentOS 7. First, we have to install strongswan and disable the firewall temporarily.</p>
<pre class="brush: bash; title: ; notranslate">
yum -y install epel-release
yum -y install strongswan
systemctl enable strongswan
systemctl stop firewalld
systemctl disable firewalld
</pre>
<p>Once installed, change these system variables so you allow IP forwarding and prevent ICMP redirects. </p>
<pre class="brush: bash; title: ; notranslate">
echo &quot;net.ipv4.ip_forward=1&quot; &gt;&gt; /etc/sysctl.conf
echo &quot;net.ipv4.conf.all.accept_redirects=0&quot; &gt;&gt; /etc/sysctl.conf
echo &quot;net.ipv4.conf.all.send_redirects=0&quot; &gt;&gt; /etc/sysctl.conf
sysctl -p /etc/sysctl.conf
</pre>
<p>strongswan on CentOS places its config under <strong>/etc/strongswan</strong> directory. We’ll use a config with pre-shared key because it’s easier to implement. So, edit the <strong>/etc/strongswan/ipsec.conf</strong> file, remove everything there and paste this config. Of course, this assumes that you don’t have any working configs there. Now, look at the highlighted lines. That’s where you have to replace the IPs and the subnets with your values. E.g. line 13 is the private IP of the CentOS server, 14 is the subnet, 15 is the ID of the server (IP or hostname), 17 is the external IP of the pfSense server, 18 is its subnet and line 19 is the ID of the pfSense server (IP or hostname). This is where the small spreadsheet above comes handy.</p>
<pre class="brush: bash; highlight: [13,14,15,17,18,19]; title: ; notranslate">
config setup

conn %default
        ikelifetime=60m
        keylife=20m
        rekeymargin=3m
        keyingtries=1
        authby=secret
        keyexchange=ikev2
        mobike=no

conn net-net
        left=148.27.56.195
        leftsubnet=10.1.96.0/20
        leftid=148.27.56.195
        leftfirewall=no
        right=23.183.125.249
        rightsubnet=192.168.1.1/24
        rightid=23.183.125.249
        ike=aes256-sha256-modp2048!
        esp=aes256-sha256!
        pfs=no
        auto=start
        lifetime=1h
</pre>
<p>Then, edit the <strong>/etc/strongswan/ipsec.secret</strong> file and specify the pre-shared key. This is a password that the servers will use to authenticate. Make sure it’s something more complex in production. In my case, the password is &#8220;<strong>secret</strong>&#8220;.</p>
<pre class="brush: bash; title: ; notranslate">	
# ipsec.secrets - strongSwan IPsec secrets file
148.27.56.195 23.183.125.249 : PSK &quot;secret&quot;
</pre>
<h1>pfSense</h1>
<p>Now that the CentOS strongswan box is configured, we can configure pfSense. In pfSense, go to <strong>VPN | IPSec</strong> from the menu and click on <strong>Add P1</strong> button. Fill out the <strong>General Information</strong> section, so it looks like this.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2019/03/P127-03.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2019/03/P127-03.png" alt="" width="1153" height="431" class="aligncenter size-full wp-image-8466" srcset="https://blog.andreev.it/wp-content/uploads/2019/03/P127-03.png 1153w, https://blog.andreev.it/wp-content/uploads/2019/03/P127-03-300x112.png 300w, https://blog.andreev.it/wp-content/uploads/2019/03/P127-03-1024x383.png 1024w, https://blog.andreev.it/wp-content/uploads/2019/03/P127-03-768x287.png 768w, https://blog.andreev.it/wp-content/uploads/2019/03/P127-03-585x219.png 585w" sizes="(max-width: 1153px) 100vw, 1153px" /></a><br />
As you can see, we use <strong>IKEv2 </strong>and our remote gateway is <strong>148.27.56.195</strong> which is the CentOS strongswan box.<br />
For <strong>Phase 1 Proposal (Authentication and Algorithms)</strong>, fill out the section so it looks like this.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2019/03/P127-04.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2019/03/P127-04.png" alt="" width="1160" height="535" class="aligncenter size-full wp-image-8467" srcset="https://blog.andreev.it/wp-content/uploads/2019/03/P127-04.png 1160w, https://blog.andreev.it/wp-content/uploads/2019/03/P127-04-300x138.png 300w, https://blog.andreev.it/wp-content/uploads/2019/03/P127-04-1024x472.png 1024w, https://blog.andreev.it/wp-content/uploads/2019/03/P127-04-768x354.png 768w, https://blog.andreev.it/wp-content/uploads/2019/03/P127-04-585x270.png 585w" sizes="(max-width: 1160px) 100vw, 1160px" /></a><br />
From the screenshot above, you can see that the values correspond to what we have in ipsec.conf file.<br />
For the <strong>Advanced Options</strong> section, use the defaults.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2019/03/P127-05.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2019/03/P127-05.png" alt="" width="1173" height="511" class="aligncenter size-full wp-image-8468" srcset="https://blog.andreev.it/wp-content/uploads/2019/03/P127-05.png 1173w, https://blog.andreev.it/wp-content/uploads/2019/03/P127-05-300x131.png 300w, https://blog.andreev.it/wp-content/uploads/2019/03/P127-05-1024x446.png 1024w, https://blog.andreev.it/wp-content/uploads/2019/03/P127-05-768x335.png 768w, https://blog.andreev.it/wp-content/uploads/2019/03/P127-05-1170x511.png 1170w, https://blog.andreev.it/wp-content/uploads/2019/03/P127-05-585x255.png 585w" sizes="(max-width: 1173px) 100vw, 1173px" /></a><br />
Click <strong>Save</strong> and then from the main <strong>IPSec | Tunnels</strong> menu, click on <strong>Add P2</strong> button.<br />
For Phase 2, fill out these values for the <strong>General Information</strong> section.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2019/03/P127-06.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2019/03/P127-06.png" alt="" width="1161" height="424" class="aligncenter size-full wp-image-8469" srcset="https://blog.andreev.it/wp-content/uploads/2019/03/P127-06.png 1161w, https://blog.andreev.it/wp-content/uploads/2019/03/P127-06-300x110.png 300w, https://blog.andreev.it/wp-content/uploads/2019/03/P127-06-1024x374.png 1024w, https://blog.andreev.it/wp-content/uploads/2019/03/P127-06-768x280.png 768w, https://blog.andreev.it/wp-content/uploads/2019/03/P127-06-585x214.png 585w" sizes="(max-width: 1161px) 100vw, 1161px" /></a><br />
Change the values for <strong>Local Network</strong> and <strong>Remote Network</strong> to suit your needs. These are the local subnets behind pfSense and strongswan.<br />
For <strong>Phase 2 Proposal (SA/Key Exchange)</strong> section, choose these values.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2019/03/P127-07.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2019/03/P127-07.png" alt="" width="1150" height="631" class="aligncenter size-full wp-image-8470" srcset="https://blog.andreev.it/wp-content/uploads/2019/03/P127-07.png 1150w, https://blog.andreev.it/wp-content/uploads/2019/03/P127-07-300x165.png 300w, https://blog.andreev.it/wp-content/uploads/2019/03/P127-07-1024x562.png 1024w, https://blog.andreev.it/wp-content/uploads/2019/03/P127-07-768x421.png 768w, https://blog.andreev.it/wp-content/uploads/2019/03/P127-07-585x321.png 585w" sizes="(max-width: 1150px) 100vw, 1150px" /></a><br />
For the <strong>Advanced Configuration</strong> section, you can leave it as is, or put the private IP of the CentOS box so the IPSec protocol sends keep-alive pings. It&#8217;s not mandatory, but if your tunnel fails frequently, you can configure this field.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2019/03/P127-08.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2019/03/P127-08.png" alt="" width="1156" height="131" class="aligncenter size-full wp-image-8471" srcset="https://blog.andreev.it/wp-content/uploads/2019/03/P127-08.png 1156w, https://blog.andreev.it/wp-content/uploads/2019/03/P127-08-300x34.png 300w, https://blog.andreev.it/wp-content/uploads/2019/03/P127-08-1024x116.png 1024w, https://blog.andreev.it/wp-content/uploads/2019/03/P127-08-768x87.png 768w, https://blog.andreev.it/wp-content/uploads/2019/03/P127-08-585x66.png 585w" sizes="(max-width: 1156px) 100vw, 1156px" /></a><br />
Click <strong>Save </strong>and the VPN config is done. But, we have to tell pfSense to allow IPSec traffic. So, from the menu go to <strong>Firewall | Rules</strong> and click on <strong>IPSec </strong>submenu. Click <strong>Add </strong>and fill out the form so it looks like this.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2019/03/P127-09.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2019/03/P127-09.png" alt="" width="1156" height="429" class="aligncenter size-full wp-image-8472" srcset="https://blog.andreev.it/wp-content/uploads/2019/03/P127-09.png 1156w, https://blog.andreev.it/wp-content/uploads/2019/03/P127-09-300x111.png 300w, https://blog.andreev.it/wp-content/uploads/2019/03/P127-09-1024x380.png 1024w, https://blog.andreev.it/wp-content/uploads/2019/03/P127-09-768x285.png 768w, https://blog.andreev.it/wp-content/uploads/2019/03/P127-09-585x217.png 585w" sizes="(max-width: 1156px) 100vw, 1156px" /></a><br />
&#8230;and this.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2019/03/P127-10.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2019/03/P127-10.png" alt="" width="1157" height="442" class="aligncenter size-full wp-image-8473" srcset="https://blog.andreev.it/wp-content/uploads/2019/03/P127-10.png 1157w, https://blog.andreev.it/wp-content/uploads/2019/03/P127-10-300x115.png 300w, https://blog.andreev.it/wp-content/uploads/2019/03/P127-10-1024x391.png 1024w, https://blog.andreev.it/wp-content/uploads/2019/03/P127-10-768x293.png 768w, https://blog.andreev.it/wp-content/uploads/2019/03/P127-10-585x223.png 585w" sizes="(max-width: 1157px) 100vw, 1157px" /></a><br />
Click <strong>Save </strong>and go back to the CentOS box.</p>
<h1>Site-to-site VPN tunnel</h1>
<p>At this point you can start the VPN.</p>
<pre class="brush: bash; title: ; notranslate">
systemctl start strongswan
</pre>
<p>If everything is OK, the log will look like this.</p>
<pre class="brush: bash; highlight: [1]; title: ; notranslate">
tail -f /var/log/messages
Mar  9 16:15:00 titan charon: 09&#x5B;NET] sending packet: from 148.27.56.195&#x5B;500] to 23.183.125.249&#x5B;500] (256 bytes)
Mar  9 16:15:00 titan charon: 10&#x5B;NET] received packet: from 23.183.125.249&#x5B;500] to 148.27.56.195&#x5B;500] (224 bytes)
Mar  9 16:15:00 titan charon: 10&#x5B;ENC] parsed IKE_AUTH response 1 &#x5B; IDr AUTH N(ESP_TFC_PAD_N) SA TSi TSr ]
Mar  9 16:15:00 titan charon: 10&#x5B;IKE] authentication of '23.183.125.249' with pre-shared key successful
Mar  9 16:15:00 titan charon: 10&#x5B;IKE] IKE_SA net-net&#x5B;1] established between 148.27.56.195&#x5B;148.27.56.195]...23.183.125.249&#x5B;23.183.125.249]
Mar  9 16:15:00 titan charon: 10&#x5B;IKE] scheduling reauthentication in 3350s
Mar  9 16:15:00 titan charon: 10&#x5B;IKE] maximum IKE_SA lifetime 3530s
Mar  9 16:15:00 titan charon: 10&#x5B;IKE] received ESP_TFC_PADDING_NOT_SUPPORTED, not using ESPv3 TFC padding
Mar  9 16:15:00 titan charon: 10&#x5B;CFG] selected proposal: ESP:AES_CBC_256/HMAC_SHA2_256_128/NO_EXT_SEQ
Mar  9 16:15:00 titan charon: 10&#x5B;IKE] CHILD_SA net-net{1} established with SPIs c82fdbae_i ce57b856_o and TS 10.1.96.0/20 === 192.168.1.0/24
</pre>
<p>Check the status.</p>
<pre class="brush: bash; highlight: [1]; title: ; notranslate">
strongswan status
Security Associations (1 up, 0 connecting):
     net-net&#x5B;3]: ESTABLISHED 3 minutes ago, 148.27.56.195&#x5B;148.27.56.195]...23.183.125.249&#x5B;23.183.125.249]
     net-net{3}:  INSTALLED, TUNNEL, reqid 2, ESP SPIs: c818e2d7_i c34c4c3d_o
     net-net{3}:   10.1.96.0/20 === 192.168.1.0/24
</pre>
<p>If the current CentOS box is not your Internet gateway for the servers behind, you have to add a static route to the pfSense subnet. So, on each server behind CentOS, do something like this.</p>
<pre class="brush: bash; title: ; notranslate">
route add 192.168.1.0 mask 255.255.255.0 10.1.96.3 -p
</pre>
<p>Check the documentation for other OSes. You have to tell the OS to use 10.1.96.3 (internal strongswan IP) as a gateway to 192.168.1.0 subnet. Because my pfSense box is also my gateway, I don&#8217;t have to make these changes. </p>
<h1>Firewall</h1>
<p>Now, everything is up and running, but we have the firewall disabled and the CentOS box is exposed to Internet. Not good. In order to fix that, we have to make some changes and allow the IPSec protocol to flow through the firewall.</p>
<pre class="brush: bash; title: ; notranslate">
systemctl enable firewalld
systemctl start firewalld
firewall-cmd --set-default-zone=dmz
firewall-cmd --zone=dmz --permanent --add-rich-rule='rule protocol value=&quot;esp&quot; accept' 
firewall-cmd --zone=dmz --permanent --add-rich-rule='rule protocol value=&quot;ah&quot; accept' 
firewall-cmd --zone=dmz --permanent --add-port=500/udp 
firewall-cmd --zone=dmz --permanent --add-port=4500/udp 
firewall-cmd --permanent --add-service=&quot;ipsec&quot;
firewall-cmd --zone=dmz --permanent --add-masquerade
firewall-cmd --permanent --direct --add-rule ipv4 nat POSTROUTING 0 -m policy --pol ipsec --dir out -j ACCEPT
firewall-cmd --reload
</pre>
<p>&#8230;and you are all set.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.andreev.it/2019/03/150-centos-pfsense-site-to-site-vpn-tunnel-with-strongswan-and-pfsense/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title>pfSense: Mobile VPN clients (Windows 10, iPhone, Ubuntu Linux, Mac OS X, Android, Linux CLI and FreeBSD)</title>
		<link>https://blog.andreev.it/2018/03/123-pfsense-mobile-vpn-clients-windows-10-iphone-linux-mac-os-x-android/</link>
					<comments>https://blog.andreev.it/2018/03/123-pfsense-mobile-vpn-clients-windows-10-iphone-linux-mac-os-x-android/#comments</comments>
		
		<dc:creator><![CDATA[Kliment Andreev]]></dc:creator>
		<pubDate>Thu, 08 Mar 2018 00:09:53 +0000</pubDate>
				<category><![CDATA[pfSense]]></category>
		<category><![CDATA[IPSec]]></category>
		<category><![CDATA[Mobile clients]]></category>
		<category><![CDATA[VPN]]></category>
		<guid isPermaLink="false">http://blog.iandreev.com/?p=3617</guid>

					<description><![CDATA[Lately, I was playing with pfSense trying to access my internal resources from outside&#8230;]]></description>
										<content:encoded><![CDATA[<div id="bsf_rt_marker"></div><p>Lately, I was playing with pfSense trying to access my internal resources from outside (mostly my <a href="https://www.plex.tv/" target="_blank" rel="noopener noreferrer">Plex </a>server) so I made this tutorial on how to access my home network. I&#8217;ve used the official <a href="https://doc.pfsense.org/index.php/IKEv2_with_EAP-MSCHAPv2" target="_blank" rel="noopener noreferrer">howto </a>from pfSense, but it&#8217;s a little bit outdated and it doesn&#8217;t cover Linux/FreeBSD non-GUI, so there are some changes that I&#8217;ve made. I&#8217;ll be using <strong>IPsec IKEv2 AES256/SHA256/MSChapV2/DH14</strong> on the pfSense side (strongSwan IPsec implementation) and the clients will use various VPN clients.<br />
There are a lot of different versions of VPN IPsec implementation, so even the slightest updates can make the VPN fail. I&#8217;ll write the version of the server/client for each configuration, so you&#8217;ll know that it works. If you are using different versions of the OS or the client, it might not work. I will use only one pfSense config for all mobile clients. Unfortunately, pfSense does not support multiple mobile clients configs as of 2.4.2.<br />
How this works? Each client will receive a certificate and a username and a password. The certificate is the same for all clients, but the username/password is not.</p>
<h1>pfSense 2.4.2</h1>
<p>In order for the VPN config to work we&#8217;ll need a Certificate Authority (CA) and a server certificate. If you have them already, then you can skip the following three parts, if not, I&#8217;ll show you how to create them.</p>
<h2>pfSense FQDN</h2>
<p>Check your FQDN first under <strong>System | General Setup</strong>. This is what I have as FQDN and I&#8217;ll use this FQDN later in my certificate and in my client&#8217;s config.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-01.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-01.png" alt="" width="1141" height="277" class="aligncenter size-full wp-image-8119" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-01.png 1141w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-01-300x73.png 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-01-1024x249.png 1024w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-01-768x186.png 768w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-01-585x142.png 585w" sizes="(max-width: 1141px) 100vw, 1141px" /></a></p>
<h2>pfSense CA (Certificate Authority)</h2>
<p>From the pfSense menu go to <strong>System | Cert. Manager</strong>. Click on <strong>Add </strong>and then you can choose to <strong>Import an existing Certificate Authority</strong> or <strong>Create an internal Certificate Authority</strong>. In my home lab I already have an existing CA (see <a href="https://blog.andreev.it/?p=3334" target="_blank" rel="noopener noreferrer">this link</a> on how to create your own CA), but for this post, I&#8217;ll create a new CA. Enter a <strong>Descriptive Name</strong> for the CA and choose to <strong>Create an internal Certificate Authority</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-02.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-02.png" alt="" width="1146" height="197" class="aligncenter size-full wp-image-8120" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-02.png 1146w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-02-300x52.png 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-02-1024x176.png 1024w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-02-768x132.png 768w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-02-585x101.png 585w" sizes="(max-width: 1146px) 100vw, 1146px" /></a><br />
Under the <strong>Internal Certificate Authority</strong> section , fill out the values that suit your home/lab/company. In my case, I used <strong>2048 </strong>for <strong>Key length (bits)</strong> and <strong>sha256 </strong>for <strong>Digest Algorithm</strong>. Enter the <strong>Lifetime</strong> of the CA, I used 3650 days which is 10 years and fill out the rest of the form. Make sure to use your FQDN for the <strong>Common Name</strong>. For example, my pfSense box has an external IP assigned to the WAN interface which is 1.2.3.4. Also, somewhere in my DNS, I resolve this IP to mysweethome.mysweetdomain.com. You have to put mysweethome.mysweetdomain.com for <strong>Common Name</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-03.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-03.png" alt="" width="1166" height="551" class="aligncenter size-full wp-image-8121" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-03.png 1166w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-03-300x142.png 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-03-1024x484.png 1024w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-03-768x363.png 768w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-03-585x276.png 585w" sizes="(max-width: 1166px) 100vw, 1166px" /></a><br />
Click <strong>Save </strong>when done.</p>
<h2>pfSense Server Certificate</h2>
<p>From the pfSense menu go to <strong>System | Cert. Manager</strong>. Click on the <strong>Certificates </strong>tab and choose <strong>Create an internal Certificate</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-04.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-04.png" alt="" width="1162" height="194" class="aligncenter size-full wp-image-8122" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-04.png 1162w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-04-300x50.png 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-04-1024x171.png 1024w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-04-768x128.png 768w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-04-585x98.png 585w" sizes="(max-width: 1162px) 100vw, 1162px" /></a><br />
For the <strong>Internal Certificate</strong> section, choose the CA that you&#8217;ve just created, keep the same <strong>Key length</strong> and <strong>Digest Algorithm</strong> and fill out the rest of the form so it looks like this.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-05.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-05.png" alt="" width="1152" height="602" class="aligncenter size-full wp-image-8123" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-05.png 1152w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-05-300x157.png 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-05-1024x535.png 1024w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-05-768x401.png 768w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-05-585x306.png 585w" sizes="(max-width: 1152px) 100vw, 1152px" /></a><br />
Again, for the <strong>Common Name</strong> choose the DNS name of your pfSense.<br />
For the <strong>Certificate Attributes</strong> section, choose a <strong>Server Certificate</strong>, not <strong>User Certificate</strong> and enter the FQDN domain of your pfSense box, as well as the IP. The IP is not mandatory, but it means that when you create your client config, you can specify the IP of the pfSense, instead of using FQDN.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-06.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-06.png" alt="" width="1152" height="441" class="aligncenter size-full wp-image-8124" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-06.png 1152w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-06-300x115.png 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-06-1024x392.png 1024w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-06-768x294.png 768w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-06-585x224.png 585w" sizes="(max-width: 1152px) 100vw, 1152px" /></a></p>
<h2>pfSense IPsec mobile clients config</h2>
<p>Once the certificates are in place, go to <strong>VPN | IPsec</strong> from the menu and then click on <strong>Mobile Clients</strong>. Enable the <strong>IKE Extensions</strong>, choose <strong>Local Database</strong> for <strong>User Authentication</strong> and <strong>none </strong>for <strong>Group Authentication</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-07.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-07.png" alt="" width="1154" height="372" class="aligncenter size-full wp-image-8125" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-07.png 1154w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-07-300x97.png 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-07-1024x330.png 1024w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-07-768x248.png 768w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-07-585x189.png 585w" sizes="(max-width: 1154px) 100vw, 1154px" /></a><br />
For the <strong>Client Configuration</strong> section, use the following settings. Check the <strong>Virtual Address Poo</strong>l and assign a subnet. This subnet will be assigned to the clients when they connect. In my case, I have a <strong>192.168.2.0/24</strong> subnet. My home subnet behind pfSense is <strong>192.168.1.0/24</strong>, so make sure that the subnet behind pfSense and the subnet for the VPN clients don&#8217;t overlap. If you want you can provide a <strong>DNS Default Domain</strong> to the VPN clients. For example, my iPhone is not joined to my local domain, so when I connect to VPN and I want to access a server on a local network, I don&#8217;t have to specify the FQDN. It will be automatically added. In addition, make sure you provide a list of <strong>DNS Servers</strong>. In my case, the first two are my local Domain Controllers and the third one is the Google&#8217;s DNS, in case the first two are down. You can also provide a login banner, although I never saw where does that shows up on any of the clients.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-08.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-08.png" alt="" width="923" height="685" class="aligncenter size-full wp-image-8126" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-08.png 923w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-08-300x223.png 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-08-768x570.png 768w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-08-585x434.png 585w" sizes="(max-width: 923px) 100vw, 923px" /></a></p>
<h2>pfSense IPsec tunnel Phase 1</h2>
<p>Go back to the <strong>Tunnels </strong>tab and click on <strong>Add P1</strong>. Fill out the first section, so it looks like this.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-09.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-09.png" alt="" width="1147" height="429" class="aligncenter size-full wp-image-8127" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-09.png 1147w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-09-300x112.png 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-09-1024x383.png 1024w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-09-768x287.png 768w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-09-585x219.png 585w" sizes="(max-width: 1147px) 100vw, 1147px" /></a><br />
For the second section <strong>Phase 1 Proposal (Authentication)</strong>, make sure that you enter the FQDN of your pfSense. This value MUST be the same as the one that you used when creating the certificates. For <strong>My Certificate</strong>, choose the certificate that you just created.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-10.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-10.png" alt="" width="1153" height="307" class="aligncenter size-full wp-image-8128" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-10.png 1153w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-10-300x80.png 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-10-1024x273.png 1024w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-10-768x204.png 768w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-10-585x156.png 585w" sizes="(max-width: 1153px) 100vw, 1153px" /></a><br />
For the thirds section <strong>Phase 1 Proposal (Algorithms)</strong>, choose<strong> AES256, SHA256</strong> and <strong>DH Group 14</strong>.<br />
And for the <strong>Advanced Options</strong>, set it up like the screenshot below.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-11.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-11.png" alt="" width="1149" height="595" class="aligncenter size-full wp-image-8129" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-11.png 1149w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-11-300x155.png 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-11-1024x530.png 1024w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-11-768x398.png 768w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-11-585x303.png 585w" sizes="(max-width: 1149px) 100vw, 1149px" /></a></p>
<h2>pfSense IPsec tunnel Phase 2</h2>
<p>For the phase 2 of the tunnel, use these settings. In my case I choose <strong>Network </strong>and <strong>0.0.0.0/0.</strong> This means that all the traffic from the clients will use the tunnel. For example, once connected, if you open up a browser and type what&#8217;s my IP in Google, you&#8217;ll get the external IP of the pfSense box. If you choose <strong>LAN Subnet</strong>, then only the traffic destined for your local home network will be using the VPN. The other Internet traffic will use whatever gateway you are connected to. For example, if I am using my iPhone connected to VPN and I use the Verizon network, the VPN will work, but if I type what&#8217;s my IP in a browser, I&#8217;ll get the external IP that Verizon provided me.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-12.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-12.png" alt="" width="1157" height="356" class="aligncenter size-full wp-image-8130" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-12.png 1157w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-12-300x92.png 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-12-1024x315.png 1024w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-12-768x236.png 768w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-12-585x180.png 585w" sizes="(max-width: 1157px) 100vw, 1157px" /></a><br />
Use the following settings for the SA/Key Exchange.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-13.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-13.png" alt="" width="1153" height="624" class="aligncenter size-full wp-image-8131" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-13.png 1153w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-13-300x162.png 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-13-1024x554.png 1024w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-13-768x416.png 768w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-13-585x317.png 585w" sizes="(max-width: 1153px) 100vw, 1153px" /></a><br />
You don&#8217;t have to do anything under <strong>Advanced Configuration</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-14.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-14.png" alt="" width="1144" height="157" class="aligncenter size-full wp-image-8132" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-14.png 1144w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-14-300x41.png 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-14-1024x141.png 1024w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-14-768x105.png 768w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-14-585x80.png 585w" sizes="(max-width: 1144px) 100vw, 1144px" /></a></p>
<h2>pfSense Client Pre-Shared Keys</h2>
<p>For each client, you will need a certificate and a username/password combo. You can&#8217;t connect with the same username and password from two different clients at the same time. The client that connects later will kick the former. So, go to <strong>VPN | IPsec</strong> and click on <strong>Pre-Shared Keys</strong> tab. Click <strong>Add </strong>to add a unique user. Make sure you choose <strong>EAP </strong>for <strong>Secret type</strong>. The <strong>Identifier </strong>is your user name, the <strong>Pre-Shared Key</strong> is your password.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-15.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-15.png" alt="" width="1163" height="283" class="aligncenter size-full wp-image-8133" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-15.png 1163w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-15-300x73.png 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-15-1024x249.png 1024w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-15-768x187.png 768w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-15-585x142.png 585w" sizes="(max-width: 1163px) 100vw, 1163px" /></a></p>
<h2>pfSense Firewall Rules for IPsec</h2>
<p>You will also need a rule that will allow the IPsec traffic. In my case, I will allow all the traffic that comes from the VPN clients. Go to <strong>Firewall | Rules </strong>and click on <strong>IPsec </strong>tab.<br />
Pretty much,you&#8217;ll have to create a rule that looks like this.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-16.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-16.png" alt="" width="1154" height="425" class="aligncenter size-full wp-image-8134" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-16.png 1154w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-16-300x110.png 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-16-1024x377.png 1024w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-16-768x283.png 768w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-16-585x215.png 585w" sizes="(max-width: 1154px) 100vw, 1154px" /></a><br />
&#8230;and this. Don&#8217;t change anything under the <strong>Display Advanced</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-17.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-17.png" alt="" width="1155" height="441" class="aligncenter size-full wp-image-8135" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-17.png 1155w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-17-300x115.png 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-17-1024x391.png 1024w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-17-768x293.png 768w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-17-585x223.png 585w" sizes="(max-width: 1155px) 100vw, 1155px" /></a><br />
When you are done, it will look like this screenshot.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-18.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-18.png" alt="" width="1149" height="222" class="aligncenter size-full wp-image-8136" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-18.png 1149w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-18-300x58.png 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-18-1024x198.png 1024w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-18-768x148.png 768w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-18-585x113.png 585w" sizes="(max-width: 1149px) 100vw, 1149px" /></a></p>
<h2>pfSense Export Certificate</h2>
<p>The final step is to export the certificate. You will have to give this to each client along with their username and password. The certificate is the same for all of them. Go to <strong>System | Cert. Manager</strong> and click on <strong>CA </strong>tab. Under the <strong>Actions</strong>, click on the icon that looks like a sun.This will download a certificate in a PEM format. Send this file to your users however you find it fit. Do not send the certificate and the username and password in the same e-mail. Do not store them together. That&#8217;s what best practices say. :)<br />
OK, we are done with pfSense, let&#8217;s move to the clients.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-19.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-19.png" alt="" width="1148" height="224" class="aligncenter size-full wp-image-8137" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-19.png 1148w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-19-300x59.png 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-19-1024x200.png 1024w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-19-768x150.png 768w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-19-585x114.png 585w" sizes="(max-width: 1148px) 100vw, 1148px" /></a></p>
<h1>Windows 10, Windows 2012R2, Windows 2016 clients</h1>
<p>These OSes work out of the box. There is no need to install any clients and no updates or service packs are needed. But, there are some changes that have to be made.</p>
<h2>CA certificate</h2>
<p>First, you&#8217;ll have to install the certificate from pfSense, the one that you&#8217;ve just downloaded. Transfer it to the Windows client and double-click on it. When the certificate shows up, click on <strong>Install Certificate</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-20.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-20.png" alt="" width="405" height="515" class="aligncenter size-full wp-image-8140" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-20.png 405w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-20-236x300.png 236w" sizes="(max-width: 405px) 100vw, 405px" /></a><br />
Select <strong>Local Machine</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-21.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-21.png" alt="" width="532" height="518" class="aligncenter size-full wp-image-8141" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-21.png 532w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-21-300x292.png 300w" sizes="(max-width: 532px) 100vw, 532px" /></a><br />
Select <strong>Place all certificates in the following store</strong>, then click <strong>Browse </strong>and choose <strong>Trusted Root Certification Authorities</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-22.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-22.png" alt="" width="531" height="571" class="aligncenter size-full wp-image-8142" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-22.png 531w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-22-279x300.png 279w" sizes="(max-width: 531px) 100vw, 531px" /></a><br />
Click <strong>Finish</strong>. You should get a pop-up saying that the import was successful.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-23.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-23.png" alt="" width="524" height="516" class="aligncenter size-full wp-image-8143" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-23.png 524w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-23-300x295.png 300w" sizes="(max-width: 524px) 100vw, 524px" /></a></p>
<h2>Registry change</h2>
<p>By default, Windows uses DH Group-2. This is a bit outdated and you&#8217;ll see later that strongSwan VPN client for Android dropped the support for this. So, we have to tell Windows to use IKEv2 with AES256 and SHA256 with DH14. Check this <a href="http://www.stevenjordan.net/2016/09/secure-ikev2-win-10.html" target="_blank" rel="noopener noreferrer">link </a>for more info (look at table 2). In essence, we need to create a new registry entry and reboot. So, launch <strong>regedit </strong>and create a new <strong>DWORD </strong>key under <strong>HKLM\SYSTEM\CurrentControlSet\Services\RasMan\Parameters</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-24.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-24.png" alt="" width="588" height="349" class="aligncenter size-full wp-image-8144" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-24.png 588w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-24-300x178.png 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-24-585x347.png 585w" sizes="(max-width: 588px) 100vw, 588px" /></a><br />
The name of the key is <strong>NegotiateDH2048_AES256</strong> and the value is <strong>2</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-25.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-25.png" alt="" width="836" height="343" class="aligncenter size-full wp-image-8145" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-25.png 836w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-25-300x123.png 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-25-768x315.png 768w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-25-585x240.png 585w" sizes="(max-width: 836px) 100vw, 836px" /></a><br />
Reboot.</p>
<h2>Create the VPN connection</h2>
<p>We&#8217;ll create the VPN now. Fire up <strong>powershell </strong>and execute these commands. Replace the <strong>ServerAddress</strong> parameter with the FQDN of your pfSense. For a detailed explanation of these commands visit the links <a href="https://docs.microsoft.com/en-us/powershell/module/vpnclient/add-vpnconnection?view=win10-ps" target="_blank" rel="noopener noreferrer">here </a>and <a href="https://docs.microsoft.com/en-us/powershell/module/vpnclient/set-vpnconnectionipsecconfiguration?view=win10-ps" target="_blank" rel="noopener noreferrer">here</a>.</p>
<pre class="brush: powershell; title: ; notranslate">
Add-VpnConnection -Name &quot;VPN2HOME&quot; -ServerAddress &quot;mysweethome.mysweetdomain.com&quot; `
-TunnelType IKEv2 -AuthenticationMethod EAP -EncryptionLevel &quot;Required&quot;
Set-VpnConnectionIPsecConfiguration -ConnectionName &quot;VPN2HOME&quot; `
-AuthenticationTransformConstants SHA256128 -CipherTransformConstants AES256  `
-EncryptionMethod AES256 -IntegrityCheckMethod SHA256 -DHGroup Group14 -PfsGroup None -PassThru
</pre>
<p>Say &#8220;Y&#8221; when prompted and you should see this.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-26.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-26.png" alt="" width="1060" height="391" class="aligncenter size-full wp-image-8146" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-26.png 1060w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-26-300x111.png 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-26-1024x378.png 1024w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-26-768x283.png 768w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-26-585x216.png 585w" sizes="(max-width: 1060px) 100vw, 1060px" /></a><br />
If you go to your <strong>Network Connections</strong>, you&#8217;ll see the VPN connection that you&#8217;ve just created.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-27.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-27.png" alt="" width="547" height="219" class="aligncenter size-full wp-image-8147" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-27.png 547w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-27-300x120.png 300w" sizes="(max-width: 547px) 100vw, 547px" /></a><br />
Right click and choose <strong>Connect/Disconnect</strong>. Enter the username and password.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-28.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-28.png" alt="" width="737" height="579" class="aligncenter size-full wp-image-8148" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-28.png 737w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-28-300x236.png 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-28-585x460.png 585w" sizes="(max-width: 737px) 100vw, 737px" /></a><br />
You are good!<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-29.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-29.png" alt="" width="496" height="250" class="aligncenter size-full wp-image-8149" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-29.png 496w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-29-300x151.png 300w" sizes="(max-width: 496px) 100vw, 496px" /></a><br />
If you go to a command prompt and do <strong>ipconfig</strong>, you&#8217;ll see that you have an IP 192.168.2.1. That&#8217;s the subnet that we allocated for the remote clients. As you can see, I can ping an internal resource.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-30.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-30.png" alt="" width="648" height="581" class="aligncenter size-full wp-image-8150" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-30.png 648w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-30-300x269.png 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-30-585x525.png 585w" sizes="(max-width: 648px) 100vw, 648px" /></a></p>
<h2>Remove the certificate (optional)</h2>
<p>If you want to remove the certificate for some reason, you can start the <strong>Certificate Manager</strong> as <strong>Start | Run</strong>, type <strong>certmgr.msc</strong> and then under <strong>Trusted Root Certification Authorities</strong> you&#8217;ll see your certificate. Right click and <strong>Delete</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-31.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-31.png" alt="" width="626" height="438" class="aligncenter size-full wp-image-8151" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-31.png 626w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-31-300x210.png 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-31-585x409.png 585w" sizes="(max-width: 626px) 100vw, 626px" /></a></p>
<h1>iPhone 11.2.6</h1>
<p>iPhone also works without any clients installed. I am not sure if earlier versions of iOS will work, but according to this <a href="https://support.apple.com/en-us/HT206154" target="_blank" rel="noopener noreferrer">Apple support document</a>, you should be able to use AES256/SHA256/DH14 as of iOS 9.3.</p>
<h2>CA Certificate</h2>
<p>The easiest way is to send the certificate as attachment. Once received in your e-mail, just tap on it.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-32.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-32.png" alt="" width="400" height="711" class="aligncenter size-full wp-image-8153" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-32.png 400w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-32-169x300.png 169w" sizes="(max-width: 400px) 100vw, 400px" /></a><br />
In the upper right corner, tap <strong>Install</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-33.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-33.png" alt="" width="400" height="711" class="aligncenter size-full wp-image-8154" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-33.png 400w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-33-169x300.png 169w" sizes="(max-width: 400px) 100vw, 400px" /></a><br />
You&#8217;ll get a warning, bypass it by tapping on <strong>Install </strong>again in the upper right corner.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-34.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-34.png" alt="" width="400" height="711" class="aligncenter size-full wp-image-8155" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-34.png 400w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-34-169x300.png 169w" sizes="(max-width: 400px) 100vw, 400px" /></a></p>
<h2>Create the VPN connection</h2>
<p>Tap on <strong>Settings </strong>and then <strong>General</strong>. Scroll a bit down until you see the <strong>VPN </strong>option.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-35.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-35.png" alt="" width="400" height="711" class="aligncenter size-full wp-image-8156" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-35.png 400w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-35-169x300.png 169w" sizes="(max-width: 400px) 100vw, 400px" /></a><br />
Tap on <strong>Add VPN Configuration</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-36.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-36.png" alt="" width="400" height="711" class="aligncenter size-full wp-image-8157" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-36.png 400w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-36-169x300.png 169w" sizes="(max-width: 400px) 100vw, 400px" /></a><br />
Choose IKEv2 for the <strong>Type</strong>, enter a <strong>Description</strong> and use the FQDN of your pfSense box for both <strong>Server</strong> and <strong>Remote ID</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-37.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-37.png" alt="" width="400" height="711" class="aligncenter size-full wp-image-8158" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-37.png 400w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-37-169x300.png 169w" sizes="(max-width: 400px) 100vw, 400px" /></a><br />
Under the <strong>Authentication </strong>section, choose <strong>Username </strong>for User <strong>Authentication </strong>and then enter your username and password. Tap Done in the upper-right corner when completed.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-38.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-38.png" alt="" width="400" height="711" class="aligncenter size-full wp-image-8159" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-38.png 400w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-38-169x300.png 169w" sizes="(max-width: 400px) 100vw, 400px" /></a><br />
Now, you can connect. Slide the button to the right under Status and within a second or two, you should be connected.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-39.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-39.png" alt="" width="400" height="711" class="aligncenter size-full wp-image-8160" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-39.png 400w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-39-169x300.png 169w" sizes="(max-width: 400px) 100vw, 400px" /></a><br />
You will see a VPN icon in the top portion of the screen, right next to your cell signal strength icon.</p>
<h2>Remove the certificate (optional)</h2>
<p>If you want to remove the certificate, tap on <strong>Settings | General</strong>, then scroll until you see the <strong>VPN </strong>entry. Right below, you&#8217;ll see an entry that says <strong>Profile</strong>. Tap on <strong>Profile</strong>. Tap on the <strong>Configuration Profile</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-40.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-40.png" alt="" width="400" height="711" class="aligncenter size-full wp-image-8161" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-40.png 400w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-40-169x300.png 169w" sizes="(max-width: 400px) 100vw, 400px" /></a><br />
Tap on <strong>Remove Profile</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-41.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-41.png" alt="" width="400" height="711" class="aligncenter size-full wp-image-8162" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-41.png 400w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-41-169x300.png 169w" sizes="(max-width: 400px) 100vw, 400px" /></a><br />
Or, you can go to <strong>Settings | General | About</strong> and then tap on <strong>Certificate Trust Settings</strong> to see your certificate. </p>
<h1>Ubuntu 17.10 (artful) and GNOME</h1>
<p>Ubuntu 17.10 doesn&#8217;t work out of the box, so some changes are needed. Same with the other clients, we&#8217;ll need a certificate and some libraries and plugins enabled.</p>
<h2>CA Certificate</h2>
<p>Transfer the pfSense CA certificate to your Ubuntu box. In my case, I&#8217;ve sent the certificate in an e-mail and then downloaded the certificate under <strong>Download </strong>folder from Firefox. We&#8217;ll have to make this certificate trusted in the certificate store. In a terminal window, do the following. You need to type what&#8217;s highlighted, the rest is the output. Pretty much, I am copying a file called <strong>pfSense+CA.crt</strong> to a folder called <strong>/usr/local/share/ca-certificates</strong> and the 2nd command is to update the CA certificates.</p>
<pre class="brush: bash; highlight: [1,2]; title: ; notranslate">
sudo cp Downloads/pfSense+CA.crt /usr/local/share/ca-certificates/
sudo update-ca-certificates
Updating certificates in /etc/ssl/certs...
1 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.
</pre>
<h2>Install libraries and plugins for strongSwan client</h2>
<p>By default, there is no IKEv2 support in GNOME Network Manager, so we&#8217;ll have to install the necessary libraries. From a command prompt install the <strong>network-manager-strongswan</strong> plugin and the libraries for the extra plugins (<strong>eap-mschapv2</strong> and <strong>eap-identity</strong>) that come with <strong>libcharon-extra-plugins</strong>.</p>
<pre class="brush: bash; title: ; notranslate">
sudo apt-get install network-manager-strongswan libcharon-extra-plugins
</pre>
<p>This is what it looks like if I check the version.</p>
<pre class="brush: bash; highlight: [1,9]; title: ; notranslate">
dpkg-query -l | grep swan
ii  libstrongswan                              5.5.1-4ubuntu2.2                            amd64        strongSwan utility and crypto library
ii  libstrongswan-extra-plugins                5.5.1-4ubuntu2.2                            amd64        strongSwan utility and crypto library (extra plugins)
ii  libstrongswan-standard-plugins             5.5.1-4ubuntu2.2                            amd64        strongSwan utility and crypto library (standard plugins)
ii  network-manager-strongswan                 1.4.2-1                                     amd64        network management framework (strongSwan plugin)
ii  strongswan-libcharon                       5.5.1-4ubuntu2.2                            amd64        strongSwan charon library
ii  strongswan-nm                              5.5.1-4ubuntu2.2                            amd64        strongSwan plugin to interact with NetworkManager
ii  strongswan-tnc-base                        5.5.1-4ubuntu2.2                            amd64        strongSwan Trusted Network Connect's (TNC) - base files
dpkg-query -l | grep charon
ii  libcharon-extra-plugins                    5.5.1-4ubuntu2.2                            amd64        strongSwan charon library (extra plugins)
ii  libcharon-standard-plugins                 5.5.1-4ubuntu2.2                            amd64        strongSwan charon library (standard plugins)
ii  strongswan-libcharon                       5.5.1-4ubuntu2.2                            amd64        strongSwan charon library
</pre>
<h2>Create the VPN connection</h2>
<p>In the upper right corner, click on the icon for the network and choose<strong> VPN Settings</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-42.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-42.png" alt="" width="406" height="319" class="aligncenter size-full wp-image-8164" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-42.png 406w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-42-300x236.png 300w" sizes="(max-width: 406px) 100vw, 406px" /></a><br />
Click on the plus <strong>(+)</strong> sign to create a new VPN connection.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-43.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-43.png" alt="" width="617" height="446" class="aligncenter size-full wp-image-8165" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-43.png 617w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-43-300x217.png 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-43-585x423.png 585w" sizes="(max-width: 617px) 100vw, 617px" /></a><br />
Choose <strong>IPsec/IKEv2 (strongswan)</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-44.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-44.png" alt="" width="501" height="244" class="aligncenter size-full wp-image-8166" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-44.png 501w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-44-300x146.png 300w" sizes="(max-width: 501px) 100vw, 501px" /></a><br />
Then fill out the form as below. If you are unable to type the password, click on the icon marked with the red arrow and choose one of the options provided for storing the password.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-45.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-45.png" alt="" width="557" height="493" class="aligncenter size-full wp-image-8167" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-45.png 557w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-45-300x266.png 300w" sizes="(max-width: 557px) 100vw, 557px" /></a><br />
Finally, click on the slider to enable VPN. If you have any issues, you can look at the logs at <strong>/var/log/syslog</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-46.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-46.png" alt="" width="623" height="348" class="aligncenter size-full wp-image-8168" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-46.png 623w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-46-300x168.png 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-46-585x327.png 585w" sizes="(max-width: 623px) 100vw, 623px" /></a></p>
<h2>Remove the certificate (optional)</h2>
<p>This is a local CA certificate file, so you can just delete the <strong>crt </strong>file that you&#8217;ve downloaded from <strong>/etc/ssl/certs</strong>, the Download folder and <strong>/usr/local/share/ca-certificates/</strong>.</p>
<h1>Mac OS X 10.13.3 High Sierra</h1>
<p>I&#8217;ve tested this configuration on High Sierra, but it should work for all OS X 10.x versions. As usual, I&#8217;ll start with the certificate.</p>
<h2>CA Certificate</h2>
<p>Transfer the certificate to your Mac and double click on it. It will prompt you for your admin password. Once completed, the <strong>Keychain</strong> will open up. This is where the certificates are stored. Find your certificate under <strong>System</strong> and double-click on it.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-47.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-47.png" alt="" width="866" height="494" class="aligncenter size-full wp-image-8170" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-47.png 866w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-47-300x171.png 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-47-768x438.png 768w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-47-585x334.png 585w" sizes="(max-width: 866px) 100vw, 866px" /></a><br />
You&#8217;ll see that the certificate is not trusted, so expand the <strong>Trust</strong> and change <strong>When using this certificate</strong> to <strong>Always Trust</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-48.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-48.png" alt="" width="509" height="427" class="aligncenter size-full wp-image-8171" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-48.png 509w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-48-300x252.png 300w" sizes="(max-width: 509px) 100vw, 509px" /></a></p>
<h2>Create the VPN connection</h2>
<p>Go to your <strong>System Preferences</strong> and click the <strong>Network</strong> icon.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-49.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-49.png" alt="" width="669" height="574" class="aligncenter size-full wp-image-8172" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-49.png 669w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-49-300x257.png 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-49-585x502.png 585w" sizes="(max-width: 669px) 100vw, 669px" /></a><br />
Click on the <strong>plus (+)</strong> icon in the bottom left corner.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-50.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-50.png" alt="" width="669" height="560" class="aligncenter size-full wp-image-8173" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-50.png 669w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-50-300x251.png 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-50-585x490.png 585w" sizes="(max-width: 669px) 100vw, 669px" /></a><br />
Change the <strong>Interface</strong> to <strong>VPN</strong>, <strong>VPN Type</strong> to <strong>IKEv2</strong> and enter some description for the <strong>Service Name</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-51.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-51.png" alt="" width="413" height="188" class="aligncenter size-full wp-image-8174" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-51.png 413w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-51-300x137.png 300w" sizes="(max-width: 413px) 100vw, 413px" /></a><br />
For the <strong>Server Address</strong> and <strong>Remote ID</strong> enter the FQDN name of your pfSense box. Click on <strong>Authentication Settings</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-52.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-52.png" alt="" width="664" height="561" class="aligncenter size-full wp-image-8175" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-52.png 664w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-52-300x253.png 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-52-585x494.png 585w" sizes="(max-width: 664px) 100vw, 664px" /></a><br />
For the <strong>Authentication Settings</strong> choose <strong>Username</strong> and enter your username and password. Once you click <strong>OK</strong> you&#8217;ll go back o the previous dialog box where you can click <strong>Connect</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-53.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-53.png" alt="" width="635" height="444" class="aligncenter size-full wp-image-8176" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-53.png 635w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-53-300x210.png 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-53-585x409.png 585w" sizes="(max-width: 635px) 100vw, 635px" /></a></p>
<h2>Remove the certificate (optional)</h2>
<p>If you want to remove the certificate, all you have to do is to launch <strong>Keychain</strong> (<strong>Go | Utilities | Keychain Access.app</strong>), find your certificate, right-click and <strong>Delete</strong>. You&#8217;ll be prompted for the admin password to do that.</p>
<h1> Android 6.x Marshmallow</h1>
<p>I&#8217;ve tested the configuration on an Android 6.x tablet and strongSwan client v1.9.6. From what I see, as long you use this client, you should be able to use the VPN even with Android 5.</p>
<h2>CA Certificate</h2>
<p>Get the certificate on the device. In my case, I sent the certificate over e-mail and used the Firefox browser to access my web based e-mail. I&#8217;ve downloaded the certificate under <strong>Downloads</strong> folder on my Android tablet. You don&#8217;t have to do anything with the certificate now, just remember where it is.</p>
<h2>Install the strongSwan client</h2>
<p>Go to the app store (Google Play), download and install the strongSwan client. </p>
<h2>Create the VPN connection</h2>
<p>Open the strongSwan client and in the upper right corner, tap on the three vertical dots.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-54.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-54.png" alt="" width="680" height="425" class="aligncenter size-full wp-image-8178" /></a><br />
Then tap on <strong>CA certificates</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-55.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-55.png" alt="" width="680" height="425" class="aligncenter size-full wp-image-8179" /></a><br />
Tap on <strong>Import certificate</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-56.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-56.png" alt="" width="680" height="425" class="aligncenter size-full wp-image-8180" /></a><br />
Select the CA certificate that you&#8217;ve just downloaded.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-57.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-57.png" alt="" width="680" height="425" class="aligncenter size-full wp-image-8181" /></a><br />
Tap on <strong>Import Certificate</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-58.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-58.png" alt="" width="680" height="425" class="aligncenter size-full wp-image-8182" /></a><br />
Once imported, go back and tap on <strong>Add VPN Profile</strong>. Fill out the form so it looks like this. For the <strong>Server</strong>, enter the FQDN of the pfSense box, choose IKEv2 EAP for <strong>VPN Type</strong>, enter the username and password and then uncheck <strong>Select automatically</strong> for <strong>CA certificate</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-59.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-59.png" alt="" width="680" height="425" class="aligncenter size-full wp-image-8183" /></a><br />
Tap <strong>Select CA certificate</strong>, tap on <strong>Imported</strong> and select the certificate that you&#8217;ve imported.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-60.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-60.png" alt="" width="680" height="425" class="aligncenter size-full wp-image-8184" /></a><br />
Click <strong>Save</strong> in the upper right corner and you are ready to connect.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P100-61.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P100-61.png" alt="" width="680" height="425" class="aligncenter size-full wp-image-8184" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P100-61.png 680w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-61-300x188.png 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P100-61-585x366.png 585w" sizes="(max-width: 680px) 100vw, 680px" /></a></p>
<h1>CentOS 7 (non-GUI)</h1>
<p>The CentOS 7 client that I am using comes with firewalld enabled and SElinux disabled. You don&#8217;t have to make any firewall changes.</p>
<h2>Install strongSwan</h2>
<p>strongSwan doesn&#8217;t come up in the standard repo, so you&#8217;ll have to install the EPEL first.</p>
<pre class="brush: bash; title: ; notranslate">
yum install epel-release
</pre>
<p>Then install strongSwan and enable it so it starts on boot.</p>
<pre class="brush: bash; title: ; notranslate">
yum install strongswan
systemctl enable strongswan
</pre>
<h2>CA Certificate</h2>
<p>Get the certificate and place it under <strong>/etc/strongswan/ipsec.d/cacerts</strong>. We will need the DN (Distinguished Name) from the certificate. Replace <strong>certfilename.crt</strong> with the name of your certificate file. </p>
<pre class="brush: bash; title: ; notranslate">
openssl x509 -noout -in /etc/strongswan/ipsec.d/cacerts/certfilename.crt -issuer
</pre>
<p>You&#8217;ll see something like this: </p>
<pre class="brush: bash; title: ; notranslate">
issuer= /C=US/ST=XY/L=Town/O=something/emailAddress=user@somedomain.com/CN=whatever/OU=YX.
</pre>
<p>Copy the value that&#8217;s after <strong>= /</strong>. </p>
<h2>Create the VPN connection</h2>
<p>Go to <strong>/etc/strongswan</strong> and edit <strong>ipsec.conf.</strong> Make sure your config file looks like this. Replace the values for <strong>right </strong>and put your FQDN of your pfSense box, enter the username under <strong>eap_identity</strong> and paste the value for the DN under <strong>rightca</strong>. </p>
<pre class="brush: bash; title: ; notranslate">
conn rw-base
    dpdaction=restart
    dpddelay=30
    dpdtimeout=90
    fragmentation=yes

conn vip-base
    also=rw-base
    leftsourceip=%config

conn ikev2-eap-mschapv2
    also=vip-base
    keyexchange=ikev2
    ike=aes256-sha256-modp2048!
    leftauth=eap-mschapv2
    rightauth=pubkey
    right=mysweethome.mysweetdomain.com
    eap_identity=darth.vader
    rightca=&quot;C=US/ST=XY/L=Town/O=something/emailAddress=user@somedomain.com/CN=whatever/OU=YX&quot;
    rightsubnet=0.0.0.0/0
    auto=add
</pre>
<p>Edit <strong>ipsec.secrets</strong> and enter your username and password.</p>
<pre class="brush: bash; title: ; notranslate">
# ipsec.secrets - strongSwan IPsec secrets file
darth.vader : EAP &quot;DeathStar01&quot;
</pre>
<p>Finally, launch the connection. </p>
<pre class="brush: bash; title: ; notranslate">
systemctl restart strongswan
strongswan up ikev2-eap-mschapv2
</pre>
<p>BTW, you can replace the <strong>ikev2-eap-mschapv2</strong> with <strong>vpn </strong>in <strong>ipsec.conf</strong> file (line 11), so you can start the connection as <strong>strongswan up vpn</strong>.<br />
You can bring the connection down with&#8230;down.</p>
<pre class="brush: bash; title: ; notranslate">
strongswan down ikev2-eap-mschapv2
</pre>
<p>You should be able to ping the internal resources now. I wasn&#8217;t able to ping the resources internally using the FQDN, only by IP. There is something how CentOS/Fedora compiled the package. See this <a href="https://wiki.strongswan.org/issues/1147" rel="noopener noreferrer" target="_blank">link</a>.<br />
I didn&#8217;t bother to investigate further. </p>
<h1>FreeBSD (non-GUI)</h1>
<p>FreeBSD comes up with the generic kernel already configured for IPsec. I didn&#8217;t test my config if my FreeBSD client is behind the NAT, but I think you should recompile the generic kernel and add support for NAT_T. Not 100% sure though, it&#8217;s on my to do list. So, this config will probably work only if your FreeBSD box has a public IP. </p>
<h2>Install strongSwan</h2>
<p>Install strongSwan from the packages.</p>
<pre class="brush: bash; title: ; notranslate">
pkg install strongswan
</pre>
<p>Let it start on boot. Add this line in <strong>/etc/rc.conf</strong>.</p>
<pre class="brush: bash; title: ; notranslate">
strongswan_enable=&quot;YES&quot;
</pre>
<h2>CA Certificate</h2>
<p>Get the certificate and place it under <strong>/usr/local/etc/ipsec.d/cacerts</strong>. We will need the DN (Distinguished Name) from the certificate. Replace <strong>certfilename.crt</strong> with the name of your certificate file. </p>
<pre class="brush: bash; title: ; notranslate">
openssl x509 -noout -in /usr/local/etc/ipsec.d/cacerts/certfilename.crt -issuer
</pre>
<p>You&#8217;ll see something like this: </p>
<pre class="brush: bash; title: ; notranslate">
issuer= /C=US/ST=XY/L=Town/O=something/emailAddress=user@somedomain.com/CN=whatever/OU=YX.
</pre>
<p>Copy the value that&#8217;s after <strong>= /</strong>. </p>
<h2>Create the VPN connection</h2>
<p>Go to <strong>/usr/local/etc</strong> and edit <strong>ipsec.conf.</strong> Make sure your config file looks like this. Replace the values for <strong>right </strong>and put your FQDN of your pfSense box, enter the username under <strong>eap_identity</strong> and paste the value for the DN under <strong>rightca</strong>. </p>
<pre class="brush: bash; title: ; notranslate">
conn rw-base
    dpdaction=restart
    dpddelay=30
    dpdtimeout=90
    fragmentation=yes

conn vip-base
    also=rw-base
    leftsourceip=%config

conn ikev2-eap-mschapv2
    also=vip-base
    keyexchange=ikev2
    ike=aes256-sha256-modp2048!
    leftauth=eap-mschapv2
    rightauth=pubkey
    right=mysweethome.mysweetdomain.com
    eap_identity=darth.vader
    rightca=&quot;C=US/ST=XY/L=Town/O=something/emailAddress=user@somedomain.com/CN=whatever/OU=YX&quot;
    rightsubnet=0.0.0.0/0
    auto=add
</pre>
<p>Edit <strong>ipsec.secrets</strong> and enter your username and password.</p>
<pre class="brush: bash; title: ; notranslate">
# ipsec.secrets - strongSwan IPsec secrets file
darth.vader : EAP &quot;DeathStar01&quot;
</pre>
<p>Finally, launch the connection. </p>
<pre class="brush: bash; title: ; notranslate">
service strongswan restart
ipsec up ikev2-eap-mschapv2
</pre>
<p>BTW, you can replace the <strong>ikev2-eap-mschapv2</strong> with <strong>vpn </strong>in <strong>ipsec.conf</strong> file (line 11), so you can start the connection as <strong>ipsec up vpn</strong>.<br />
You can bring the connection down with&#8230;down.</p>
<pre class="brush: bash; title: ; notranslate">
ipsec down ikev2-eap-mschapv2
</pre>
<p>You should be able to ping the internal resources now. </p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.andreev.it/2018/03/123-pfsense-mobile-vpn-clients-windows-10-iphone-linux-mac-os-x-android/feed/</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
			</item>
		<item>
		<title>AWS, pfsense: Site-to-site VPN using static routes</title>
		<link>https://blog.andreev.it/2018/03/122-aws-pfsense-site-to-site-vpn-using-static-routes/</link>
					<comments>https://blog.andreev.it/2018/03/122-aws-pfsense-site-to-site-vpn-using-static-routes/#respond</comments>
		
		<dc:creator><![CDATA[Kliment Andreev]]></dc:creator>
		<pubDate>Fri, 02 Mar 2018 22:55:45 +0000</pubDate>
				<category><![CDATA[AWS]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[pfSense]]></category>
		<category><![CDATA[IPSec]]></category>
		<category><![CDATA[Site-to-Site]]></category>
		<category><![CDATA[Tunnel]]></category>
		<category><![CDATA[VPN]]></category>
		<guid isPermaLink="false">http://blog.iandreev.com/?p=3588</guid>

					<description><![CDATA[In this post I&#8217;ll describe how to configure a tunnel between pfSense and AWS.&#8230;]]></description>
										<content:encoded><![CDATA[<div id="bsf_rt_marker"></div><p>In this post I&#8217;ll describe how to configure a tunnel between pfSense and AWS. At home I have a box running pfSense 2.4.2 as a firewall/gateway and my internal network is 192.168.1.0/24.<br />
First things first, let&#8217;s configure AWS.</p>
<h1>AWS</h1>
<p><a href="https://blog.andreev.it/wp-content/uploads/2018/03/P099-01.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P099-01.jpg" alt="" width="160" height="159" class="aligncenter size-full wp-image-7939" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P099-01.jpg 160w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-01-150x150.jpg 150w" sizes="(max-width: 160px) 100vw, 160px" /></a>Log to your AWS account and go to your VPC. On your left side at the bottom, you&#8217;ll see these items.</p>
<p>Click on <strong>Customer Gateways</strong> first and then click to create a <strong>Customer Gateway</strong>. Name your gateway connection and enter the external IP of your pfSense box.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P099-02.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P099-02.jpg" alt="" width="1288" height="397" class="aligncenter size-full wp-image-7940" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P099-02.jpg 1288w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-02-300x92.jpg 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-02-1024x316.jpg 1024w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-02-768x237.jpg 768w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-02-1170x361.jpg 1170w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-02-585x180.jpg 585w" sizes="(max-width: 1288px) 100vw, 1288px" /></a><br />
Go back to the same entries on the left and click to create a <strong>Virtual Private Gateway</strong>. Name your Virtual Private Gateway.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P099-03.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P099-03.jpg" alt="" width="1297" height="342" class="aligncenter size-full wp-image-7941" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P099-03.jpg 1297w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-03-300x79.jpg 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-03-1024x270.jpg 1024w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-03-768x203.jpg 768w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-03-1170x309.jpg 1170w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-03-585x154.jpg 585w" sizes="(max-width: 1297px) 100vw, 1297px" /></a><br />
Go back again and this time click the last option to create a <strong>VPN Connection</strong>.<br />
Name it, choose the <strong>Virtual Private Gateway</strong> that you just created and also choose the <strong>Customer Gateway</strong> that you created initially.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P099-04.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P099-04.jpg" alt="" width="950" height="404" class="aligncenter size-full wp-image-7942" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P099-04.jpg 950w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-04-300x128.jpg 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-04-768x327.jpg 768w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-04-585x249.jpg 585w" sizes="(max-width: 950px) 100vw, 950px" /></a><br />
For the<strong> Routing Options</strong>, select <strong>Static</strong> and enter the subnet that&#8217;s behind your pfSense. If you have more subnets at home/work, add them all if you want to be reachable.<br />
You don&#8217;t have to enter anything for <strong>Tunnel Options</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P099-05.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P099-05.jpg" alt="" width="950" height="404" class="aligncenter size-full wp-image-7942" /></a><br />
Go back to the initial entries and click <strong>Virtual Private Gateway</strong>. Select your <strong>Virtual Private Gateway</strong> and from the <strong>Actions</strong>, choose <strong>Attach to VPC</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P099-06.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P099-06.png" alt="" width="607" height="197" class="aligncenter size-full wp-image-7944" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P099-06.png 607w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-06-300x97.png 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-06-585x190.png 585w" sizes="(max-width: 607px) 100vw, 607px" /></a><br />
Choose the VPC that you will use.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P099-07.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P099-07.jpg" alt="" width="1297" height="1031" class="aligncenter size-full wp-image-7943" /></a><br />
Again, go back to the initial entries, select <strong>VPN Connections</strong> and click on <strong>Download Configuration</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P099-08.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P099-08.png" alt="" width="607" height="197" class="aligncenter size-full wp-image-7944" /></a><br />
When prompted, choose the configuration for pfSense.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P099-09.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P099-09.jpg" alt="" width="585" height="338" class="aligncenter size-full wp-image-7947" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P099-09.jpg 585w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-09-300x173.jpg 300w" sizes="(max-width: 585px) 100vw, 585px" /></a><br />
You&#8217;ll get a text file. Make sure you open this with Wordpad or Notepad++. Notepad won&#8217;t display it correctly. This file tells you pretty much what to do on the pfSense side.</p>
<h1>pfSense</h1>
<p>Go to your pfSense box and choose <strong>VPN | IPsec</strong> from the menus. You&#8217;ll see something like this.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P099-10.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P099-10.jpg" alt="" width="1154" height="205" class="aligncenter size-full wp-image-7948" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P099-10.jpg 1154w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-10-300x53.jpg 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-10-1024x182.jpg 1024w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-10-768x136.jpg 768w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-10-585x104.jpg 585w" sizes="(max-width: 1154px) 100vw, 1154px" /></a><br />
Click on <strong>Add P1</strong>. Fill out the values from the text file that you just downloaded from AWS. It looks like this.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P099-11.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P099-11.jpg" alt="" width="1151" height="429" class="aligncenter size-full wp-image-7949" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P099-11.jpg 1151w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-11-300x112.jpg 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-11-1024x382.jpg 1024w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-11-768x286.jpg 768w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-11-585x218.jpg 585w" sizes="(max-width: 1151px) 100vw, 1151px" /></a><br />
&#8230;and this.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P099-12.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P099-12.jpg" alt="" width="1150" height="329" class="aligncenter size-full wp-image-7950" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P099-12.jpg 1150w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-12-300x86.jpg 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-12-1024x293.jpg 1024w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-12-768x220.jpg 768w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-12-585x167.jpg 585w" sizes="(max-width: 1150px) 100vw, 1150px" /></a><br />
&#8230;and this.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P099-13.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P099-13.jpg" alt="" width="1152" height="270" class="aligncenter size-full wp-image-7951" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P099-13.jpg 1152w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-13-300x70.jpg 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-13-1024x240.jpg 1024w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-13-768x180.jpg 768w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-13-585x137.jpg 585w" sizes="(max-width: 1152px) 100vw, 1152px" /></a><br />
&#8230;and finally this. Click <strong>Save</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P099-14.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P099-14.jpg" alt="" width="1165" height="515" class="aligncenter size-full wp-image-7952" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P099-14.jpg 1165w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-14-300x133.jpg 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-14-1024x453.jpg 1024w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-14-768x340.jpg 768w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-14-585x259.jpg 585w" sizes="(max-width: 1165px) 100vw, 1165px" /></a><br />
Click <strong>Apply</strong> and then click on <strong>Add P2</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P099-15.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P099-15.jpg" alt="" width="1161" height="359" class="aligncenter size-full wp-image-7953" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P099-15.jpg 1161w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-15-300x93.jpg 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-15-1024x317.jpg 1024w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-15-768x237.jpg 768w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-15-585x181.jpg 585w" sizes="(max-width: 1161px) 100vw, 1161px" /></a><br />
As with Phase 1, do the same for Phase 2. Read the values from the text file so it looks like this. For the <strong>Remote Network</strong> subnet, enter the subnet of your VPC. You can get that if you click on the VPC and check the <strong>IPv4 CIDR</strong> column.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P099-16.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P099-16.jpg" alt="" width="1146" height="409" class="aligncenter size-full wp-image-7954" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P099-16.jpg 1146w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-16-300x107.jpg 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-16-1024x365.jpg 1024w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-16-768x274.jpg 768w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-16-585x209.jpg 585w" sizes="(max-width: 1146px) 100vw, 1146px" /></a><br />
Keep entering the values.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P099-17.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P099-17.jpg" alt="" width="1150" height="622" class="aligncenter size-full wp-image-7955" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P099-17.jpg 1150w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-17-300x162.jpg 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-17-1024x554.jpg 1024w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-17-768x415.jpg 768w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-17-585x316.jpg 585w" sizes="(max-width: 1150px) 100vw, 1150px" /></a><br />
For some reason, my VPN tunnel got disconnected a lot if there was no traffic, so under <strong>Advanced Configuration </strong>I had to enter an internal IP of an AWS instance to be pinged all the time to keep the traffic flow.<br />
Click <strong>Save</strong> and then <strong>Apply Changes</strong>.<br />
Now, we have to allow the traffic coming from AWS to our internal network.<br />
From the menus in pfSense, go to <strong>Firewall | Rules</strong> and click on <strong>IPsec</strong>. Click <strong>Add</strong> and allow the traffic that suits your needs. In my case, I allow all the traffic.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P099-18.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P099-18.jpg" alt="" width="1159" height="427" class="aligncenter size-full wp-image-7956" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P099-18.jpg 1159w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-18-300x111.jpg 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-18-1024x377.jpg 1024w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-18-768x283.jpg 768w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-18-585x216.jpg 585w" sizes="(max-width: 1159px) 100vw, 1159px" /></a><br />
..and this.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P099-19.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P099-19.jpg" alt="" width="1157" height="444" class="aligncenter size-full wp-image-7957" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P099-19.jpg 1157w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-19-300x115.jpg 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-19-1024x393.jpg 1024w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-19-768x295.jpg 768w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-19-585x224.jpg 585w" sizes="(max-width: 1157px) 100vw, 1157px" /></a><br />
Once you apply the changes it should look like this.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P099-20.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P099-20.jpg" alt="" width="1164" height="299" class="aligncenter size-full wp-image-7958" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P099-20.jpg 1164w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-20-300x77.jpg 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-20-1024x263.jpg 1024w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-20-768x197.jpg 768w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-20-585x150.jpg 585w" sizes="(max-width: 1164px) 100vw, 1164px" /></a><br />
Go to <strong>Status | IPsec</strong> from the menus and click <strong>Connect</strong>. If everything is OK, you&#8217;ll see the connection established.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P099-21.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P099-21.jpg" alt="" width="1175" height="249" class="aligncenter size-full wp-image-7959" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P099-21.jpg 1175w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-21-300x64.jpg 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-21-1024x217.jpg 1024w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-21-768x163.jpg 768w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-21-1170x249.jpg 1170w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-21-585x124.jpg 585w" sizes="(max-width: 1175px) 100vw, 1175px" /></a><br />
Now, we have the rules in place that allows the traffic originating from AWS to pfSense to pass through, but if you want the traffic originating from your internal network to reach AWS, you&#8217;ll have to assign AWS Security groups to the instances that allow traffic from your internal network.<br />
In my case, I have a security group that looks like this. It is assigned to all of my AWS intances. It allows traffic from my internal network to reach AWS.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P099-22.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P099-22.jpg" alt="" width="1022" height="229" class="aligncenter size-full wp-image-7960" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P099-22.jpg 1022w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-22-300x67.jpg 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-22-768x172.jpg 768w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-22-585x131.jpg 585w" sizes="(max-width: 1022px) 100vw, 1022px" /></a><br />
But that&#8217;s not all. Because we are using static routes, we have to tell AWS to use the Virtual Private Gateway to reach our internal network. If you go back to AWS and click on route tables you&#8217;ll see something like this.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P099-23.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P099-23.jpg" alt="" width="788" height="499" class="aligncenter size-full wp-image-7961" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P099-23.jpg 788w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-23-300x190.jpg 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-23-768x486.jpg 768w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-23-585x370.jpg 585w" sizes="(max-width: 788px) 100vw, 788px" /></a><br />
This means that all the traffic that goes to 172.31.0.0/16 subnet, which is the VPC&#8217;s internal subnet should use local routing and all other traffic to use igw-b31598d6 which is the <strong>Internet gateway</strong>. But, we don&#8217;t want that. If an instance in AWS tries to reach an instance behind pfSense it will try to reach it over the Internet. So, we have to tell AWS to use the <strong>Virtual Private Gateway</strong> for our local subnet.<br />
So, click on<strong> Route Propagation</strong> and see how the <strong>Propagate</strong> field says <strong>No</strong>. We have to <strong>Edit</strong> that and check the checkmark, so all the internal traffic uses the <strong>Virtual Private Gateway</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P099-24.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P099-24.jpg" alt="" width="709" height="259" class="aligncenter size-full wp-image-7962" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P099-24.jpg 709w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-24-300x110.jpg 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-24-585x214.jpg 585w" sizes="(max-width: 709px) 100vw, 709px" /></a><br />
Once completed you should see something like this under the <strong>Routes</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P099-25.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P099-25.jpg" alt="" width="714" height="317" class="aligncenter size-full wp-image-7963" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P099-25.jpg 714w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-25-300x133.jpg 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-25-585x260.jpg 585w" sizes="(max-width: 714px) 100vw, 714px" /></a><br />
At this point you should be able to reach all instances back and forth. Also, make sure that the VPN tunnel is UP on the AWS side. Don&#8217;t worry about the second tunnel down. By default, AWS provides you two redundant tunnels. Since we have only one pfSense with a single public IP, we don&#8217;t have to worry about the 2nd tunnel&#8230;unless you have 2 pfSense boxes in a cluster with 2 public IPs.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2018/03/P099-26.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2018/03/P099-26.jpg" alt="" width="794" height="275" class="aligncenter size-full wp-image-7964" srcset="https://blog.andreev.it/wp-content/uploads/2018/03/P099-26.jpg 794w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-26-300x104.jpg 300w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-26-768x266.jpg 768w, https://blog.andreev.it/wp-content/uploads/2018/03/P099-26-585x203.jpg 585w" sizes="(max-width: 794px) 100vw, 794px" /></a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.andreev.it/2018/03/122-aws-pfsense-site-to-site-vpn-using-static-routes/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>pfSense, Azure: Site-to-Site VPN between Azure and pfSense</title>
		<link>https://blog.andreev.it/2017/10/115-azure-site-site-vpn-azure-pfsense/</link>
					<comments>https://blog.andreev.it/2017/10/115-azure-site-site-vpn-azure-pfsense/#respond</comments>
		
		<dc:creator><![CDATA[Kliment Andreev]]></dc:creator>
		<pubDate>Sun, 08 Oct 2017 23:26:50 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[pfSense]]></category>
		<category><![CDATA[Site-to-Site]]></category>
		<category><![CDATA[VPN Tunnel]]></category>
		<guid isPermaLink="false">http://blog.iandreev.com/?p=3250</guid>

					<description><![CDATA[In this blog post I&#8217;ll describe how to create a VPN connection between an&#8230;]]></description>
										<content:encoded><![CDATA[<div id="bsf_rt_marker"></div><p>In this blog post I&#8217;ll describe how to create a VPN connection between an Azure subscription and a pfSense router with a public IP using dynamic routing. Before we proceed, you have to understand that the subnets can&#8217;t overlap in Azure and behind pfSense. So, if your home network is 192.168.1.0/24, you can&#8217;t have the same subnet in Azure. It is also a good practice to write down your subnets and subnet masks before hand, so there are no errors when creating the tunnel. Many times, the tunnel won&#8217;t work just because you are rushing things and not paying attention to the subnets and masks. So, here is my setup.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/10/P093-01.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/10/P093-01.png" alt="" width="456" height="145" class="aligncenter size-full wp-image-7761" srcset="https://blog.andreev.it/wp-content/uploads/2017/10/P093-01.png 456w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-01-300x95.png 300w" sizes="(max-width: 456px) 100vw, 456px" /></a><br />
In my home lab I have a pfSense with a public IP (1.2.3.4) and my internal network behind pfSense is 192.168.1.0/24. In Azure, I will create a subnet for the servers that will be part of a bigger network. So, I&#8217;ll create a vNet with an address space of 10.0.0.0/23, I&#8217;ll carve a smaller subnet 10.0.0.0/24 and use the rest 10.0.1.0/24 for the Virtual Network Gateway. Write down your values.</p>
<h1>Create Azure VPN</h1>
<h2>Virtual Network and subnets</h2>
<p>Log in to Azure (the new portal using Resource Manager), select your default subscription or if you have only one (Pay As You Go), just go and create a new vNet. Fill out the necessary values to suit your needs and click <strong>Create</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/10/P093-02.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/10/P093-02.png" alt="" width="328" height="757" class="aligncenter size-full wp-image-7762" srcset="https://blog.andreev.it/wp-content/uploads/2017/10/P093-02.png 328w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-02-130x300.png 130w" sizes="(max-width: 328px) 100vw, 328px" /></a><br />
I will have 256 IP addresses for the servers and 256 IPs for the gateway.<br />
Once the vNet creation completes, usually in 10-15 seconds, click on the bell icon in the upper right corner and click on <strong>Go to resource</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/10/P093-03.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/10/P093-03.png" alt="" width="430" height="259" class="aligncenter size-full wp-image-7763" srcset="https://blog.andreev.it/wp-content/uploads/2017/10/P093-03.png 430w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-03-300x181.png 300w" sizes="(max-width: 430px) 100vw, 430px" /></a><br />
There, click on <strong>Subnets.</strong><br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/10/P093-04.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/10/P093-04.png" alt="" width="246" height="624" class="aligncenter size-full wp-image-7764" srcset="https://blog.andreev.it/wp-content/uploads/2017/10/P093-04.png 246w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-04-118x300.png 118w" sizes="(max-width: 246px) 100vw, 246px" /></a><br />
Click on <strong>Gateway Subnet</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/10/P093-05.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/10/P093-05.png" alt="" width="543" height="190" class="aligncenter size-full wp-image-7765" srcset="https://blog.andreev.it/wp-content/uploads/2017/10/P093-05.png 543w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-05-300x105.png 300w" sizes="(max-width: 543px) 100vw, 543px" /></a><br />
Verify the settings, but for me Azure filled out the subnet correctly with 10.0.1.0/24. You can&#8217;t change the name of this subnet. Just click OK.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/10/P093-06.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/10/P093-06.png" alt="" width="602" height="406" class="aligncenter size-full wp-image-7766" srcset="https://blog.andreev.it/wp-content/uploads/2017/10/P093-06.png 602w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-06-300x202.png 300w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-06-585x395.png 585w" sizes="(max-width: 602px) 100vw, 602px" /></a></p>
<h2>Virtual Network Gateway</h2>
<p>Virtual Network Gateway is the the actual VPN tunnel. Click on <strong>New</strong>, <strong>Networking</strong> and then <strong>Virtual Network Gateway</strong>.</p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2017/10/P093-07.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/10/P093-07.png" alt="" width="766" height="379" class="aligncenter size-full wp-image-7767" srcset="https://blog.andreev.it/wp-content/uploads/2017/10/P093-07.png 766w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-07-300x148.png 300w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-07-585x289.png 585w" sizes="(max-width: 766px) 100vw, 766px" /></a><br />
I used the following values when creating the gateway.For the <strong>SKU</strong>, I choose <strong>Basic</strong>. To see what each of them means, visit this <a href="https://docs.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-about-vpngateways" rel="noopener noreferrer" target="_blank">link</a>, pretty much it&#8217;s about the number of connections and the bandwidth that you&#8217;ll get. Choose the <strong>vnetAzure </strong>for the <strong>Virtual network</strong> and create a new <strong>Public IP address</strong>. I named my IP <strong>ipVPN</strong>. Click <strong>Create</strong> at the end. The creation takes about 30 mins. Once created, click on the <strong>ipVPN </strong>resource that you created and get your public Azure IP. Write this value down.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/10/P093-08.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/10/P093-08.png" alt="" width="318" height="708" class="aligncenter size-full wp-image-7768" srcset="https://blog.andreev.it/wp-content/uploads/2017/10/P093-08.png 318w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-08-135x300.png 135w" sizes="(max-width: 318px) 100vw, 318px" /></a></p>
<h2>Local Network Gateway</h2>
<p>Once the <strong>Virtual Network Gateway</strong> is provisioned, go and create a <strong>Local Network Gateway</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/10/P093-09.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/10/P093-09.png" alt="" width="509" height="291" class="aligncenter size-full wp-image-7769" srcset="https://blog.andreev.it/wp-content/uploads/2017/10/P093-09.png 509w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-09-300x172.png 300w" sizes="(max-width: 509px) 100vw, 509px" /></a><br />
In my case, it looks like this.  The IP address <strong>1.2.3.4</strong> (of course not) is the public IP of my pfSense at home and the address space <strong>192.168.1.0/24</strong> is my home network behind the pfSense. Choose the same resource group as the vNet, virtual network gateway tunnel and the same location. Click <strong>Create</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/10/P093-10.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/10/P093-10.png" alt="" width="328" height="767" class="aligncenter size-full wp-image-7770" srcset="https://blog.andreev.it/wp-content/uploads/2017/10/P093-10.png 328w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-10-128x300.png 128w" sizes="(max-width: 328px) 100vw, 328px" /></a></p>
<h2>Connections</h2>
<p>Once created, select your local network gateway and click on <strong>Connections</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/10/P093-11.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/10/P093-11.png" alt="" width="276" height="573" class="aligncenter size-full wp-image-7771" srcset="https://blog.andreev.it/wp-content/uploads/2017/10/P093-11.png 276w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-11-145x300.png 145w" sizes="(max-width: 276px) 100vw, 276px" /></a><br />
Click <strong>Add</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/10/P093-12.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/10/P093-12.png" alt="" width="552" height="207" class="aligncenter size-full wp-image-7772" srcset="https://blog.andreev.it/wp-content/uploads/2017/10/P093-12.png 552w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-12-300x113.png 300w" sizes="(max-width: 552px) 100vw, 552px" /></a><br />
Choose a name, in my case <strong>connVPN</strong>, choose the virtual network gateway and the local network gateway that we just created and create your shared key. This is the key that the IPsec tunnel will exchange when establishing connection. Choose something more complex and longer, not something like I used.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/10/P093-13.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/10/P093-13.png" alt="" width="311" height="644" class="aligncenter size-full wp-image-7773" srcset="https://blog.andreev.it/wp-content/uploads/2017/10/P093-13.png 311w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-13-145x300.png 145w" sizes="(max-width: 311px) 100vw, 311px" /></a><br />
Once the creation finishes, you are pretty much done in Azure for the first part.</p>
<h1>pfSense</h1>
<h2>VPN/IPsec</h2>
<p>Log in to your pfSense and from the menus go to <strong>VPN/IPsec</strong>. Click on <strong>Add P1</strong> at bottom right. This is to create the first phase of the IPsec tunnel negotiation.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/10/P093-14.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/10/P093-14.png" alt="" width="980" height="463" class="aligncenter size-full wp-image-7774" srcset="https://blog.andreev.it/wp-content/uploads/2017/10/P093-14.png 980w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-14-300x142.png 300w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-14-768x363.png 768w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-14-585x276.png 585w" sizes="(max-width: 980px) 100vw, 980px" /></a><br />
Fill out these values and make sure that you replace with your IPs. For the <strong>General Information</strong> section I used this. 52.168.160.233 is my Azure public IP. Yours is different.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/10/P093-15.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/10/P093-15.png" alt="" width="951" height="580" class="aligncenter size-full wp-image-7775" srcset="https://blog.andreev.it/wp-content/uploads/2017/10/P093-15.png 951w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-15-300x183.png 300w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-15-768x468.png 768w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-15-585x357.png 585w" sizes="(max-width: 951px) 100vw, 951px" /></a><br />
For <strong>Phase 1 Proposal (Authentication)</strong> use these values and enter your shared key.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/10/P093-16.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/10/P093-16.png" alt="" width="947" height="325" class="aligncenter size-full wp-image-7776" srcset="https://blog.andreev.it/wp-content/uploads/2017/10/P093-16.png 947w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-16-300x103.png 300w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-16-768x264.png 768w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-16-585x201.png 585w" sizes="(max-width: 947px) 100vw, 947px" /></a><br />
For <strong>Phase 1 Proposal (Algorithms)</strong> use these values.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/10/P093-17.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/10/P093-17.png" alt="" width="948" height="287" class="aligncenter size-full wp-image-7777" srcset="https://blog.andreev.it/wp-content/uploads/2017/10/P093-17.png 948w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-17-300x91.png 300w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-17-768x233.png 768w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-17-585x177.png 585w" sizes="(max-width: 948px) 100vw, 948px" /></a><br />
For the <strong>Advanced Options</strong>, use these values and click <strong>Save</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/10/P093-18.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/10/P093-18.png" alt="" width="954" height="448" class="aligncenter size-full wp-image-7778" srcset="https://blog.andreev.it/wp-content/uploads/2017/10/P093-18.png 954w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-18-300x141.png 300w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-18-768x361.png 768w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-18-585x275.png 585w" sizes="(max-width: 954px) 100vw, 954px" /></a><br />
Once the screen goes back to the main <strong>VPN/IPsec/Tunnels</strong> menu, click <strong>Apply Changes</strong>. From the same screen, click <strong>Show Phase 2 Entries</strong> for the entry we just created. I have two, the first one is for AWS, so I used the 2nd one.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/10/P093-19.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/10/P093-19.png" alt="" width="976" height="461" class="aligncenter size-full wp-image-7779" srcset="https://blog.andreev.it/wp-content/uploads/2017/10/P093-19.png 976w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-19-300x142.png 300w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-19-768x363.png 768w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-19-585x276.png 585w" sizes="(max-width: 976px) 100vw, 976px" /></a><br />
Click <strong>Add P2</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/10/P093-20.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/10/P093-20.png" alt="" width="947" height="139" class="aligncenter size-full wp-image-7780" srcset="https://blog.andreev.it/wp-content/uploads/2017/10/P093-20.png 947w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-20-300x44.png 300w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-20-768x113.png 768w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-20-585x86.png 585w" sizes="(max-width: 947px) 100vw, 947px" /></a><br />
For the <strong>General Information</strong> section, use these values. Under <strong>Remote Network</strong>, enter the <strong>vNet Address Space</strong>, not the server subnet. Look all the way above and make sure you have the same values in what you&#8217;ve written and what are you typing here.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/10/P093-21.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/10/P093-21.png" alt="" width="1153" height="423" class="aligncenter size-full wp-image-7781" srcset="https://blog.andreev.it/wp-content/uploads/2017/10/P093-21.png 1153w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-21-300x110.png 300w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-21-1024x376.png 1024w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-21-768x282.png 768w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-21-585x215.png 585w" sizes="(max-width: 1153px) 100vw, 1153px" /></a><br />
For the <strong>Phase 2 Proposal (SA/Key Exchange)</strong> I am using these values.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/10/P093-22.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/10/P093-22.png" alt="" width="953" height="659" class="aligncenter size-full wp-image-7782" srcset="https://blog.andreev.it/wp-content/uploads/2017/10/P093-22.png 953w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-22-300x207.png 300w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-22-768x531.png 768w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-22-585x405.png 585w" sizes="(max-width: 953px) 100vw, 953px" /></a><br />
Finally, for the <strong>Advanced Configuration</strong>, you can leave it as is and click <strong>Save</strong>. I&#8217;ve noticed that if there is no activity in the tunnel between the resources in Azure and my home, the tunnel shuts down from time to time. But, if I enter an IP of an Azure server here, pfsense will ping this host so the traffic will flow constantly and the tunnel stays up. Of course, you have to make sure that your Azure resource allows ICMP in a security group (which is not by default).<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/10/P093-23.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/10/P093-23.png" alt="" width="957" height="173" class="aligncenter size-full wp-image-7783" srcset="https://blog.andreev.it/wp-content/uploads/2017/10/P093-23.png 957w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-23-300x54.png 300w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-23-768x139.png 768w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-23-585x106.png 585w" sizes="(max-width: 957px) 100vw, 957px" /></a></p>
<p>OK, now that you have your P2 phase set up, click <strong>Apply Changes</strong> again. From the main menu, go to <strong>Status, IPsec</strong> and you should see your tunnel established.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/10/P093-24.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/10/P093-24.png" alt="" width="1150" height="306" class="aligncenter size-full wp-image-7784" srcset="https://blog.andreev.it/wp-content/uploads/2017/10/P093-24.png 1150w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-24-300x80.png 300w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-24-1024x272.png 1024w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-24-768x204.png 768w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-24-585x156.png 585w" sizes="(max-width: 1150px) 100vw, 1150px" /></a><br />
pfSense is locked down quite a bit by default, so we have to open up the firewall for the IPsec traffic. In order to do that, from the main menu go to <strong>Firewall, Rules </strong>and then click on the <strong>IPsec </strong>sub-menu.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/10/P093-25.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/10/P093-25.png" alt="" width="1179" height="344" class="aligncenter size-full wp-image-7785" srcset="https://blog.andreev.it/wp-content/uploads/2017/10/P093-25.png 1179w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-25-300x88.png 300w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-25-1024x299.png 1024w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-25-768x224.png 768w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-25-1170x341.png 1170w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-25-585x171.png 585w" sizes="(max-width: 1179px) 100vw, 1179px" /></a><br />
Click <strong>Add </strong>and fill out the form with the following values. This will allow all traffic to flow from Azure to pfSense without any restrictions. If you want to restrict the rules, e.g. you don&#8217;t want ping to be allowed, then you have to create a rule to deny ICMP or create two rules, one for TCP and one for UDP. In my case, I don&#8217;t mind all the traffic so I used any to any.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/10/P093-26.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/10/P093-26.png" alt="" width="1149" height="587" class="aligncenter size-full wp-image-7786" srcset="https://blog.andreev.it/wp-content/uploads/2017/10/P093-26.png 1149w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-26-300x153.png 300w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-26-1024x523.png 1024w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-26-768x392.png 768w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-26-585x299.png 585w" sizes="(max-width: 1149px) 100vw, 1149px" /></a><br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/10/P093-27.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/10/P093-27.png" alt="" width="1167" height="273" class="aligncenter size-full wp-image-7787" srcset="https://blog.andreev.it/wp-content/uploads/2017/10/P093-27.png 1167w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-27-300x70.png 300w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-27-1024x240.png 1024w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-27-768x180.png 768w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-27-585x137.png 585w" sizes="(max-width: 1167px) 100vw, 1167px" /></a><br />
There are no <strong>Advanced Options</strong> needed. Just click <strong>OK </strong>and you are good to go.</p>
<h1>Test</h1>
<p>In order to test, I&#8217;ll build a new Windows 2016 VM. Make sure that this VM is in the same resource group as the VPN gateway, uses the vNet that we created and that the subnet is the one for the servers, <strong>subServers</strong>. You don&#8217;t need a public IP. Once you provision this VM, go to the <strong>Networking </strong>properties of the VM and look up the internal IP. It should be in the same subnet as the <strong>subServers </strong>subnet. In my case it&#8217;s 10.0.0.4.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/10/P093-28.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/10/P093-28.png" alt="" width="866" height="377" class="aligncenter size-full wp-image-7788" srcset="https://blog.andreev.it/wp-content/uploads/2017/10/P093-28.png 866w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-28-300x131.png 300w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-28-768x334.png 768w, https://blog.andreev.it/wp-content/uploads/2017/10/P093-28-585x255.png 585w" sizes="(max-width: 866px) 100vw, 866px" /></a><br />
At this point you should be able to RDP to this VM, but ping won&#8217;t work. Why? Because, when you create a VM in Azure, it creates a security group that allows RDP only, but not ping (ICMP). Now, if you log to your new VM in Azure and try to ping a resource on your local home network, you&#8217;ll see that you can ping it. Why? Because in pfSense we created a rule that allows all traffic from Azure to pfSense to pass. If you want all traffic in both directions, you&#8217;ll need a new security group in Azure that allows all traffic and attach this security group to your instances.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.andreev.it/2017/10/115-azure-site-site-vpn-azure-pfsense/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>pfSense: Access your media from the Internet</title>
		<link>https://blog.andreev.it/2017/08/110-pfsense-plex-access-media-internet/</link>
					<comments>https://blog.andreev.it/2017/08/110-pfsense-plex-access-media-internet/#respond</comments>
		
		<dc:creator><![CDATA[Kliment Andreev]]></dc:creator>
		<pubDate>Sun, 13 Aug 2017 14:19:21 +0000</pubDate>
				<category><![CDATA[pfSense]]></category>
		<guid isPermaLink="false">http://blog.iandreev.com/?p=3123</guid>

					<description><![CDATA[I use Plex to watch some of my movies, but I&#8217;ve always watched them&#8230;]]></description>
										<content:encoded><![CDATA[<div id="bsf_rt_marker"></div><p>I use Plex to watch some of my movies, but I&#8217;ve always watched them from home. Because I was going on vacation, I decided to enable Plex to stream my movies over the Internet. My pfSense is release 2.3.4 and Plex is 1.7.5.4035.</p>
<div style="border:1px solid red; padding:16px;">
<p style="text-align:center;"><strong><span style="color:#800000;">You will need a paid Plex subscription in order to have remote access.</span> </strong></p>
</div>
<p>My home network is behind a pfSense, so I had to create some NAT rules in the firewall to allow outside access. But first, let&#8217;s configure Plex. Open your server GUI and click on the Settings icon in the upper right corner.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/08/P088-01.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/08/P088-01.png" alt="" width="253" height="79" class="aligncenter size-full wp-image-7660" /></a></p>
<p>Then click on the <strong>Server</strong> menu and <strong>Remote Access</strong> sub menu. Click on <strong>Manually specify public port</strong> and enter <strong>32400</strong>. Click <strong>Apply</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/08/P088-02.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/08/P088-02.png" alt="" width="1161" height="570" class="aligncenter size-full wp-image-7661" srcset="https://blog.andreev.it/wp-content/uploads/2017/08/P088-02.png 1161w, https://blog.andreev.it/wp-content/uploads/2017/08/P088-02-300x147.png 300w, https://blog.andreev.it/wp-content/uploads/2017/08/P088-02-1024x503.png 1024w, https://blog.andreev.it/wp-content/uploads/2017/08/P088-02-768x377.png 768w, https://blog.andreev.it/wp-content/uploads/2017/08/P088-02-585x287.png 585w" sizes="(max-width: 1161px) 100vw, 1161px" /></a></p>
<p>In pfSense, go to <strong>Firewall</strong> then <strong>NAT</strong> from the menus. Click <strong>Add</strong> and enter the following values.</p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2017/08/P088-03.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/08/P088-03.png" alt="" width="535" height="163" class="aligncenter size-full wp-image-7662" srcset="https://blog.andreev.it/wp-content/uploads/2017/08/P088-03.png 535w, https://blog.andreev.it/wp-content/uploads/2017/08/P088-03-300x91.png 300w" sizes="(max-width: 535px) 100vw, 535px" /></a><br />
&#8211; Destination Port Range, (other) &#8211; 32400, (other) &#8211; 32400<br />
&#8211; Redirect Target IP  &#8211; 192.168.x.y (or whatever your internal IP for the Plex server is)<br />
&#8211; Redirect Target Port &#8211; 32400<br />
&#8211; Description &#8211; Something like Plex Remote Access<br />
&#8211; NAT Reflection &#8211; Enable (NAT + Proxy). </p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2017/08/P088-04.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/08/P088-04.png" alt="" width="1158" height="725" class="aligncenter size-full wp-image-7663" srcset="https://blog.andreev.it/wp-content/uploads/2017/08/P088-04.png 1158w, https://blog.andreev.it/wp-content/uploads/2017/08/P088-04-300x188.png 300w, https://blog.andreev.it/wp-content/uploads/2017/08/P088-04-1024x641.png 1024w, https://blog.andreev.it/wp-content/uploads/2017/08/P088-04-768x481.png 768w, https://blog.andreev.it/wp-content/uploads/2017/08/P088-04-585x366.png 585w" sizes="(max-width: 1158px) 100vw, 1158px" /></a><br />
<a href="https://blog.andreev.it/wp-content/uploads/2017/08/P088-05.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2017/08/P088-05.png" alt="" width="1143" height="264" class="aligncenter size-full wp-image-7664" srcset="https://blog.andreev.it/wp-content/uploads/2017/08/P088-05.png 1143w, https://blog.andreev.it/wp-content/uploads/2017/08/P088-05-300x69.png 300w, https://blog.andreev.it/wp-content/uploads/2017/08/P088-05-1024x237.png 1024w, https://blog.andreev.it/wp-content/uploads/2017/08/P088-05-768x177.png 768w, https://blog.andreev.it/wp-content/uploads/2017/08/P088-05-585x135.png 585w" sizes="(max-width: 1143px) 100vw, 1143px" /></a><br />
Click <strong>Save</strong> and <strong>Apply Changes</strong>. You can now access your content, but Plex GUI won&#8217;t show the changes. Just log off and log back on and you should see the green check for OK. If not, click <strong>Retry</strong>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.andreev.it/2017/08/110-pfsense-plex-access-media-internet/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>pfSense: Install on Qotom-Q180S mini computer</title>
		<link>https://blog.andreev.it/2016/12/100-pfsense-install-qotom-q180s/</link>
					<comments>https://blog.andreev.it/2016/12/100-pfsense-install-qotom-q180s/#comments</comments>
		
		<dc:creator><![CDATA[Kliment Andreev]]></dc:creator>
		<pubDate>Sun, 04 Dec 2016 01:04:57 +0000</pubDate>
				<category><![CDATA[pfSense]]></category>
		<category><![CDATA[mini computer]]></category>
		<guid isPermaLink="false">http://blog.iandreev.com/?p=2916</guid>

					<description><![CDATA[I used pfSense a lot in the past 6 months, but I never got&#8230;]]></description>
										<content:encoded><![CDATA[<div id="bsf_rt_marker"></div><p>I used pfSense a lot in the past 6 months, but I never got any chance to write about it. So, for my 100th post, I&#8217;ll talk about it a bit and this will be a placeholder for future reference. </p>
<p>At my home, I was using a Netgear Nighthawk AC1900 (R7000), but this Wi-Fi router has a lot of limitations. I&#8217;ve decided to go with a full blown PC, but I needed a one that&#8217;s not a desktop/laptop size. After some research I&#8217;ve decided to buy Qotom-Q180S from <a href="https://www.amazon.com/gp/product/B0148IN1N2/ref=oh_aui_detailpage_o09_s00?ie=UTF8&#038;psc=1" target="_blank" rel="noopener noreferrer">Amazon</a>. It&#8217;s about $150 and it arrived in 3 days from Hong Kong. It&#8217;s great because there are no moving parts (no fan, no HDD). </p>
<p>First, go to https://www.pfsense.org/download/ and download the ISO. </p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2016/12/P079-01.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2016/12/P079-01.png" alt="" width="563" height="334" class="aligncenter size-full wp-image-7585" srcset="https://blog.andreev.it/wp-content/uploads/2016/12/P079-01.png 563w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-01-300x178.png 300w" sizes="(max-width: 563px) 100vw, 563px" /></a><br />
Use something like <a href="https://rufus.akeo.ie/" target="_blank" rel="noopener noreferrer">Rufus </a>to transfer the image to an USB stick. </p>
<p>Go to the BIOS and choose to boot from USB. You can also see how big is the unit compared to a pen.</p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2016/12/P079-02.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2016/12/P079-02.jpg" alt="" width="1920" height="1080" class="aligncenter size-full wp-image-7586" srcset="https://blog.andreev.it/wp-content/uploads/2016/12/P079-02.jpg 1920w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-02-300x169.jpg 300w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-02-1024x576.jpg 1024w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-02-768x432.jpg 768w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-02-1536x864.jpg 1536w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-02-1170x658.jpg 1170w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-02-585x329.jpg 585w" sizes="(max-width: 1920px) 100vw, 1920px" /></a><br />
When pfSense boots up, you&#8217;ll see something like this.</p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2016/12/P079-03.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2016/12/P079-03.jpg" alt="" width="1920" height="1080" class="aligncenter size-full wp-image-7587" srcset="https://blog.andreev.it/wp-content/uploads/2016/12/P079-03.jpg 1920w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-03-300x169.jpg 300w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-03-1024x576.jpg 1024w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-03-768x432.jpg 768w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-03-1536x864.jpg 1536w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-03-1170x658.jpg 1170w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-03-585x329.jpg 585w" sizes="(max-width: 1920px) 100vw, 1920px" /></a><br />
Use the default. </p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2016/12/P079-04.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2016/12/P079-04.jpg" alt="" width="1920" height="1080" class="aligncenter size-full wp-image-7588" srcset="https://blog.andreev.it/wp-content/uploads/2016/12/P079-04.jpg 1920w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-04-300x169.jpg 300w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-04-1024x576.jpg 1024w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-04-768x432.jpg 768w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-04-1536x864.jpg 1536w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-04-1170x658.jpg 1170w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-04-585x329.jpg 585w" sizes="(max-width: 1920px) 100vw, 1920px" /></a><br />
Choose Custom install.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2016/12/P079-05.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2016/12/P079-05.jpg" alt="" width="1920" height="1080" class="aligncenter size-full wp-image-7589" srcset="https://blog.andreev.it/wp-content/uploads/2016/12/P079-05.jpg 1920w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-05-300x169.jpg 300w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-05-1024x576.jpg 1024w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-05-768x432.jpg 768w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-05-1536x864.jpg 1536w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-05-1170x658.jpg 1170w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-05-585x329.jpg 585w" sizes="(max-width: 1920px) 100vw, 1920px" /></a></p>
<p>Choose the SSD drive (32GB) that comes with the unit, not the USB drive. </p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2016/12/P079-06.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2016/12/P079-06.jpg" alt="" width="1920" height="1080" class="aligncenter size-full wp-image-7590" srcset="https://blog.andreev.it/wp-content/uploads/2016/12/P079-06.jpg 1920w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-06-300x169.jpg 300w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-06-1024x576.jpg 1024w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-06-768x432.jpg 768w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-06-1536x864.jpg 1536w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-06-1170x658.jpg 1170w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-06-585x329.jpg 585w" sizes="(max-width: 1920px) 100vw, 1920px" /></a><br />
Format the disk, the unit comes with Windows 7 that&#8217;s not activated.</p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2016/12/P079-07.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2016/12/P079-07.jpg" alt="" width="1920" height="1080" class="aligncenter size-full wp-image-7591" srcset="https://blog.andreev.it/wp-content/uploads/2016/12/P079-07.jpg 1920w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-07-300x169.jpg 300w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-07-1024x576.jpg 1024w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-07-768x432.jpg 768w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-07-1536x864.jpg 1536w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-07-1170x658.jpg 1170w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-07-585x329.jpg 585w" sizes="(max-width: 1920px) 100vw, 1920px" /></a><br />
Just use the defaults.</p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2016/12/P079-08.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2016/12/P079-08.jpg" alt="" width="1920" height="1080" class="aligncenter size-full wp-image-7592" srcset="https://blog.andreev.it/wp-content/uploads/2016/12/P079-08.jpg 1920w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-08-300x169.jpg 300w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-08-1024x576.jpg 1024w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-08-768x432.jpg 768w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-08-1536x864.jpg 1536w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-08-1170x658.jpg 1170w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-08-585x329.jpg 585w" sizes="(max-width: 1920px) 100vw, 1920px" /></a><br />
Yep, format. </p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2016/12/P079-09.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2016/12/P079-09.jpg" alt="" width="1920" height="1080" class="aligncenter size-full wp-image-7593" srcset="https://blog.andreev.it/wp-content/uploads/2016/12/P079-09.jpg 1920w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-09-300x169.jpg 300w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-09-1024x576.jpg 1024w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-09-768x432.jpg 768w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-09-1536x864.jpg 1536w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-09-1170x658.jpg 1170w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-09-585x329.jpg 585w" sizes="(max-width: 1920px) 100vw, 1920px" /></a><br />
Tab to Accept and Create and hit Enter.</p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2016/12/P079-10.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2016/12/P079-10.jpg" alt="" width="1920" height="1080" class="aligncenter size-full wp-image-7594" srcset="https://blog.andreev.it/wp-content/uploads/2016/12/P079-10.jpg 1920w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-10-300x169.jpg 300w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-10-1024x576.jpg 1024w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-10-768x432.jpg 768w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-10-1536x864.jpg 1536w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-10-1170x658.jpg 1170w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-10-585x329.jpg 585w" sizes="(max-width: 1920px) 100vw, 1920px" /></a><br />
Same thing, Accept and Install Bootblocks.</p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2016/12/P079-11.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2016/12/P079-11.jpg" alt="" width="1920" height="1080" class="aligncenter size-full wp-image-7595" srcset="https://blog.andreev.it/wp-content/uploads/2016/12/P079-11.jpg 1920w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-11-300x169.jpg 300w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-11-1024x576.jpg 1024w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-11-768x432.jpg 768w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-11-1536x864.jpg 1536w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-11-1170x658.jpg 1170w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-11-585x329.jpg 585w" sizes="(max-width: 1920px) 100vw, 1920px" /></a><br />
Use the default.</p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2016/12/P079-12.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2016/12/P079-12.jpg" alt="" width="1920" height="1080" class="aligncenter size-full wp-image-7596" srcset="https://blog.andreev.it/wp-content/uploads/2016/12/P079-12.jpg 1920w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-12-300x169.jpg 300w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-12-1024x576.jpg 1024w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-12-768x432.jpg 768w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-12-1536x864.jpg 1536w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-12-1170x658.jpg 1170w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-12-585x329.jpg 585w" sizes="(max-width: 1920px) 100vw, 1920px" /></a><br />
It&#8217;s all defaults, 4GB of swap because I have 2GB RAM.</p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2016/12/P079-13.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2016/12/P079-13.jpg" alt="" width="1920" height="1080" class="aligncenter size-full wp-image-7597" srcset="https://blog.andreev.it/wp-content/uploads/2016/12/P079-13.jpg 1920w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-13-300x169.jpg 300w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-13-1024x576.jpg 1024w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-13-768x432.jpg 768w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-13-1536x864.jpg 1536w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-13-1170x658.jpg 1170w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-13-585x329.jpg 585w" sizes="(max-width: 1920px) 100vw, 1920px" /></a><br />
Use a standard kernel.</p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2016/12/P079-14.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2016/12/P079-14.jpg" alt="" width="1920" height="1080" class="aligncenter size-full wp-image-7598" srcset="https://blog.andreev.it/wp-content/uploads/2016/12/P079-14.jpg 1920w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-14-300x169.jpg 300w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-14-1024x576.jpg 1024w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-14-768x432.jpg 768w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-14-1536x864.jpg 1536w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-14-1170x658.jpg 1170w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-14-585x329.jpg 585w" sizes="(max-width: 1920px) 100vw, 1920px" /></a><br />
Hit reboot and remove the USB stick.</p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2016/12/P079-15.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2016/12/P079-15.jpg" alt="" width="1920" height="1080" class="aligncenter size-full wp-image-7599" srcset="https://blog.andreev.it/wp-content/uploads/2016/12/P079-15.jpg 1920w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-15-300x169.jpg 300w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-15-1024x576.jpg 1024w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-15-768x432.jpg 768w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-15-1536x864.jpg 1536w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-15-1170x658.jpg 1170w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-15-585x329.jpg 585w" sizes="(max-width: 1920px) 100vw, 1920px" /></a><br />
Once it comes back, choose no for VLANs. </p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2016/12/P079-16.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2016/12/P079-16.jpg" alt="" width="1920" height="1080" class="aligncenter size-full wp-image-7600" srcset="https://blog.andreev.it/wp-content/uploads/2016/12/P079-16.jpg 1920w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-16-300x169.jpg 300w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-16-1024x576.jpg 1024w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-16-768x432.jpg 768w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-16-1536x864.jpg 1536w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-16-1170x658.jpg 1170w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-16-585x329.jpg 585w" sizes="(max-width: 1920px) 100vw, 1920px" /></a><br />
At this point, you&#8217;ll have to know where you plugged your cable from your cable/DSL modem into the unit. You should plug your external cable to the NIC that&#8217;s marked as 1 and your internal switch or Wi-Fi router to NIC2. pfSense marks them as re0 and re1. re0 is the NIC1, re1 is NIC2. I used re0 because my cable modem is connected to NIC1.</p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2016/12/P079-17.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2016/12/P079-17.jpg" alt="" width="1920" height="1080" class="aligncenter size-full wp-image-7601" srcset="https://blog.andreev.it/wp-content/uploads/2016/12/P079-17.jpg 1920w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-17-300x169.jpg 300w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-17-1024x576.jpg 1024w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-17-768x432.jpg 768w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-17-1536x864.jpg 1536w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-17-1170x658.jpg 1170w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-17-585x329.jpg 585w" sizes="(max-width: 1920px) 100vw, 1920px" /></a><br />
Use re1 for the internal LAN.</p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2016/12/P079-18.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2016/12/P079-18.jpg" alt="" width="1920" height="1080" class="aligncenter size-full wp-image-7602" srcset="https://blog.andreev.it/wp-content/uploads/2016/12/P079-18.jpg 1920w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-18-300x169.jpg 300w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-18-1024x576.jpg 1024w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-18-768x432.jpg 768w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-18-1536x864.jpg 1536w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-18-1170x658.jpg 1170w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-18-585x329.jpg 585w" sizes="(max-width: 1920px) 100vw, 1920px" /></a><br />
Hit Enter key.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2016/12/P079-19.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2016/12/P079-19.jpg" alt="" width="1920" height="1080" class="aligncenter size-full wp-image-7603" srcset="https://blog.andreev.it/wp-content/uploads/2016/12/P079-19.jpg 1920w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-19-300x169.jpg 300w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-19-1024x576.jpg 1024w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-19-768x432.jpg 768w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-19-1536x864.jpg 1536w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-19-1170x658.jpg 1170w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-19-585x329.jpg 585w" sizes="(max-width: 1920px) 100vw, 1920px" /></a><br />
Verify all is OK and type y to proceed.</p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2016/12/P079-20.jpg"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2016/12/P079-20.jpg" alt="" width="1920" height="1080" class="aligncenter size-full wp-image-7604" srcset="https://blog.andreev.it/wp-content/uploads/2016/12/P079-20.jpg 1920w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-20-300x169.jpg 300w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-20-1024x576.jpg 1024w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-20-768x432.jpg 768w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-20-1536x864.jpg 1536w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-20-1170x658.jpg 1170w, https://blog.andreev.it/wp-content/uploads/2016/12/P079-20-585x329.jpg 585w" sizes="(max-width: 1920px) 100vw, 1920px" /></a><br />
At this point you are all set. The IP for the internal interface is set to 192.168.1.1/24.<br />
All you have to do is to point all your internal devices to use 192.168.1.1 as gateway and be on the same subnet. </p>
<p>You can log in to http://192.168.1.1, use admin/pfsense as password.<br />
In my next posts I&#8217;ll go over VPN, squid etc&#8230;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.andreev.it/2016/12/100-pfsense-install-qotom-q180s/feed/</wfw:commentRss>
			<slash:comments>6</slash:comments>
		
		
			</item>
		<item>
		<title>pfSense, AWS: pfSense 2.2 &#038; Amazon AWS site-to-site VPN tunnel (IPsec)</title>
		<link>https://blog.andreev.it/2015/03/pfsense-2-2-amazon-aws-site-to-site/</link>
					<comments>https://blog.andreev.it/2015/03/pfsense-2-2-amazon-aws-site-to-site/#comments</comments>
		
		<dc:creator><![CDATA[Kliment Andreev]]></dc:creator>
		<pubDate>Tue, 03 Mar 2015 17:44:57 +0000</pubDate>
				<category><![CDATA[AWS]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[pfSense]]></category>
		<category><![CDATA[IPSec]]></category>
		<category><![CDATA[VPN]]></category>
		<guid isPermaLink="false">http://blog.iandreev.com/?p=1820</guid>

					<description><![CDATA[In this post I&#8217;ll describe how to establish a site to site connection with&#8230;]]></description>
										<content:encoded><![CDATA[<div id="bsf_rt_marker"></div><p>In this post I&#8217;ll describe how to establish a site to site connection with Amazon&#8217;s <a href="http://aws.amazon.com/" target="_blank" rel="noopener noreferrer">AWS cloud</a>. We&#8217;ll use <a href="https://www.pfsense.org" target="_blank" rel="noopener noreferrer">pfSense</a> 2.2, build two instances in the cloud and expand our internal network to Amazon over IPsec tunnel. Make sure that you use pfSense 2.2. They&#8217;ve changed the IPsec from racoon to strongswan in this version, so I am not sure if the scenario described below will work with earlier versions. It should, because the parameters are the same, but you never know. In this post, I won&#8217;t hide any IPs or shared keys. These instances will be long gone when you read this.</p>
<p>Make sure you have a working pfSense instance with WAN and LAN adapters already configured. You will need this info. The public IP, the local IP and the local subnet. In my case the local subnet for the LAN IP is <strong>10.99.0.0/16</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2015/03/P051-01.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2015/03/P051-01.png" alt="" width="379" height="157" class="aligncenter size-full wp-image-7225" srcset="https://blog.andreev.it/wp-content/uploads/2015/03/P051-01.png 379w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-01-300x124.png 300w" sizes="(max-width: 379px) 100vw, 379px" /></a></p>
<div style="border:1px solid red; padding:16px;">
<p style="text-align:center;"><strong><span style="color:#800000;">IMPORTANT</span> </strong></p>
<p>You need a public IP on the pfSense WAN. You can&#8217;t use NAT or any type of port forwarding. This won&#8217;t work. Also, pfSense should not be placed on AWS, it should go to another cloud provider or at your home.
</p>
</div>
<h1>AWS</h1>
<p>Log on to AWS portal and select <strong>VPC</strong>.</p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2015/03/P051-02.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2015/03/P051-02.png" alt="" width="638" height="355" class="aligncenter size-full wp-image-7226" srcset="https://blog.andreev.it/wp-content/uploads/2015/03/P051-02.png 638w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-02-300x167.png 300w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-02-585x326.png 585w" sizes="(max-width: 638px) 100vw, 638px" /></a></p>
<p>Click on <strong>Start VPC Wizard</strong> button.</p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2015/03/P051-03.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2015/03/P051-03.png" alt="" width="681" height="407" class="aligncenter size-full wp-image-7227" srcset="https://blog.andreev.it/wp-content/uploads/2015/03/P051-03.png 681w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-03-300x179.png 300w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-03-585x350.png 585w" sizes="(max-width: 681px) 100vw, 681px" /></a></p>
<p>Choose the third option, <strong>VPC with Public and Private Subnets and Hardware VPN Access</strong>. We&#8217;ll build two instances (VMs). One in the public space and one in the private space. The public instance can be reached from outside, but this instance can also reach the private instance. The private instance can reach the public instance and our local network.</p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2015/03/P051-04.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2015/03/P051-04.png" alt="" width="1051" height="449" class="aligncenter size-full wp-image-7228" srcset="https://blog.andreev.it/wp-content/uploads/2015/03/P051-04.png 1051w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-04-300x128.png 300w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-04-1024x437.png 1024w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-04-768x328.png 768w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-04-585x250.png 585w" sizes="(max-width: 1051px) 100vw, 1051px" /></a></p>
<div style="border:1px solid red; padding:16px;">
<p style="text-align:center;"><strong><span style="color:#800000;">IMPORTANT</span> </strong></p>
<p>Make sure that your internal subnet does not overlap with the AWS subnet. IPsec can work only between different subnets.
</p>
</div>
<p>I&#8217;ll use <strong>10.100.0.0/16 </strong>as a VPC subnet and then carve two smaller subnets, <strong>100.100.0.0/24 </strong>which will be my <strong>Public subnet </strong>(named BLOG Public subnet) and <strong>10.100.1.0/24 </strong>as my <strong>Private subnet </strong>(named BLOG Private subnet).</p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2015/03/P051-05.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2015/03/P051-05.png" alt="" width="739" height="435" class="aligncenter size-full wp-image-7229" srcset="https://blog.andreev.it/wp-content/uploads/2015/03/P051-05.png 739w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-05-300x177.png 300w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-05-585x344.png 585w" sizes="(max-width: 739px) 100vw, 739px" /></a></p>
<p>Specify the <strong>Customer Gateway IP</strong> (that&#8217;s the public IP of pfSense), choose <strong>Static</strong> for <strong>Routing Type</strong> and enter the LAN subnet on the pfSense side. Name the <strong>Customer Gateway</strong> and <strong>VPN Connection</strong> accordingly and click on <strong>Create VPC</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2015/03/P051-06.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2015/03/P051-06.png" alt="" width="1337" height="478" class="aligncenter size-full wp-image-7230" srcset="https://blog.andreev.it/wp-content/uploads/2015/03/P051-06.png 1337w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-06-300x107.png 300w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-06-1024x366.png 1024w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-06-768x275.png 768w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-06-1170x418.png 1170w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-06-585x209.png 585w" sizes="(max-width: 1337px) 100vw, 1337px" /></a><br />
Once completed (after 2-3 minutes), click on <strong>Virtual Private Gateways </strong>and name your gateway.</p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2015/03/P051-07.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2015/03/P051-07.png" alt="" width="561" height="432" class="aligncenter size-full wp-image-7231" srcset="https://blog.andreev.it/wp-content/uploads/2015/03/P051-07.png 561w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-07-300x231.png 300w" sizes="(max-width: 561px) 100vw, 561px" /></a></p>
<p>Click on <strong>Route Tables </strong>and rename your routes. You will notice that the route for the public subnet has <strong>BLOG Public subnet </strong>associated. Name this route as Public Route or however you want. In my case it&#8217;s <strong>BLOG Public Route</strong>.</p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2015/03/P051-08.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2015/03/P051-08.png" alt="" width="815" height="498" class="aligncenter size-full wp-image-7232" srcset="https://blog.andreev.it/wp-content/uploads/2015/03/P051-08.png 815w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-08-300x183.png 300w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-08-768x469.png 768w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-08-585x357.png 585w" sizes="(max-width: 815px) 100vw, 815px" /></a></p>
<p>Click on the other route and name it, in my case <strong>BLOG Private Route</strong>. Then click on <strong>Subnet Associations </strong>and click <strong>Edit</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2015/03/P051-09.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2015/03/P051-09.png" alt="" width="683" height="428" class="aligncenter size-full wp-image-7233" srcset="https://blog.andreev.it/wp-content/uploads/2015/03/P051-09.png 683w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-09-300x188.png 300w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-09-585x367.png 585w" sizes="(max-width: 683px) 100vw, 683px" /></a></p>
<p>Associate this route with the <strong>BLOG Private Subnet </strong>and click <strong>Save</strong>.</p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2015/03/P051-10.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2015/03/P051-10.png" alt="" width="754" height="149" class="aligncenter size-full wp-image-7234" srcset="https://blog.andreev.it/wp-content/uploads/2015/03/P051-10.png 754w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-10-300x59.png 300w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-10-585x116.png 585w" sizes="(max-width: 754px) 100vw, 754px" /></a></p>
<p>At this point, we&#8217;ll create two Amazon Linux instances, but let&#8217;s see what we have.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2015/03/P051-11.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2015/03/P051-11.png" alt="" width="487" height="84" class="aligncenter size-full wp-image-7235" srcset="https://blog.andreev.it/wp-content/uploads/2015/03/P051-11.png 487w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-11-300x52.png 300w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-11-480x84.png 480w" sizes="(max-width: 487px) 100vw, 487px" /></a></p>
<p>Go back to the home screen and click on <strong>EC2</strong>.</p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2015/03/P051-12.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2015/03/P051-12.png" alt="" width="325" height="199" class="aligncenter size-full wp-image-7236" srcset="https://blog.andreev.it/wp-content/uploads/2015/03/P051-12.png 325w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-12-300x184.png 300w" sizes="(max-width: 325px) 100vw, 325px" /></a><br />
I won&#8217;t go into details, but pick Amazon Linux AMI, choose the CPU/RAM resources (micro, small, etc&#8230;), and then select the proper VPC, the public subnet and enable auto public IP as below. This is our AMI with public access.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2015/03/P051-13.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2015/03/P051-13.png" alt="" width="772" height="338" class="aligncenter size-full wp-image-7237" srcset="https://blog.andreev.it/wp-content/uploads/2015/03/P051-13.png 772w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-13-300x131.png 300w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-13-768x336.png 768w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-13-585x256.png 585w" sizes="(max-width: 772px) 100vw, 772px" /></a></p>
<p>Tag the instance so you know which one is the public.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2015/03/P051-14.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2015/03/P051-14.png" alt="" width="941" height="173" class="aligncenter size-full wp-image-7238" srcset="https://blog.andreev.it/wp-content/uploads/2015/03/P051-14.png 941w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-14-300x55.png 300w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-14-768x141.png 768w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-14-585x108.png 585w" sizes="(max-width: 941px) 100vw, 941px" /></a></p>
<p>Create or use an existing security group, just make sure SSH is allowed.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2015/03/P051-15.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2015/03/P051-15.png" alt="" width="1321" height="457" class="aligncenter size-full wp-image-7239" srcset="https://blog.andreev.it/wp-content/uploads/2015/03/P051-15.png 1321w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-15-300x104.png 300w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-15-1024x354.png 1024w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-15-768x266.png 768w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-15-1170x405.png 1170w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-15-585x202.png 585w" sizes="(max-width: 1321px) 100vw, 1321px" /></a><br />
And finally create or reuse an existing key pair. It doesn&#8217;t matter as long as you know how to use this. Then, create another instance, this time use the private subnet. Name the instance accordingly.</p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2015/03/P051-16.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2015/03/P051-16.png" alt="" width="864" height="412" class="aligncenter size-full wp-image-7240" srcset="https://blog.andreev.it/wp-content/uploads/2015/03/P051-16.png 864w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-16-300x143.png 300w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-16-768x366.png 768w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-16-585x279.png 585w" sizes="(max-width: 864px) 100vw, 864px" /></a></p>
<p>From a public IP, ssh to the public AMI. I won&#8217;t go into details (see this <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstancesLinux.html" target="_blank" rel="noopener noreferrer">link</a>), but copy the key to this AMI and from here, duplicate this session in putty and ssh to the private AMI. It looks like this on my computer. So, the idea is to ssh to the public, copy the ssh key to the public in order to access the private AMI. </p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2015/03/P051-17.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2015/03/P051-17.png" alt="" width="559" height="345" class="aligncenter size-full wp-image-7241" srcset="https://blog.andreev.it/wp-content/uploads/2015/03/P051-17.png 559w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-17-300x185.png 300w" sizes="(max-width: 559px) 100vw, 559px" /></a></p>
<p>You can use the public AMI as a backdoor to get to the private AMI. Without the tunnel, you won&#8217;t be able to log to the private AMI. Before we can create the tunnel, go back to the VPC menu, click on the <strong>VPN connections </strong>and then <strong>Tunnel Details </strong>tab. Get the IPs. We&#8217;ll use only the first one. You can create two IPsec tunnels in pfSense if you want. It&#8217;s the same procedure. AWS uses two IPs for their gateways for redundancy.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2015/03/P051-18.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2015/03/P051-18.png" alt="" width="637" height="363" class="aligncenter size-full wp-image-7242" srcset="https://blog.andreev.it/wp-content/uploads/2015/03/P051-18.png 637w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-18-300x171.png 300w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-18-585x333.png 585w" sizes="(max-width: 637px) 100vw, 637px" /></a></p>
<p>Now that you have the external IPs of the Amazon gateway, click on <strong>Download Configuration</strong> and choose the generic one. Open this file with Wordpad or Notepad++. Notepad won&#8217;t work, there is no support for U*NIX line-endings.</p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2015/03/P051-19.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2015/03/P051-19.png" alt="" width="737" height="216" class="aligncenter size-full wp-image-7243" srcset="https://blog.andreev.it/wp-content/uploads/2015/03/P051-19.png 737w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-19-300x88.png 300w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-19-585x171.png 585w" sizes="(max-width: 737px) 100vw, 737px" /></a></p>
<h1>pfSense, IPsec</h1>
<p>Switch back to pfSense and from the menu, select <strong>VPN | IPsec</strong>.</p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2015/03/P051-20.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2015/03/P051-20.png" alt="" width="483" height="83" class="aligncenter size-full wp-image-7244" srcset="https://blog.andreev.it/wp-content/uploads/2015/03/P051-20.png 483w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-20-300x52.png 300w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-20-480x83.png 480w" sizes="(max-width: 483px) 100vw, 483px" /></a><br />
Check <strong>Enable IPsec</strong> and create the<strong> Phase 1</strong> (the plus sign on the right).</p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2015/03/P051-21.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2015/03/P051-21.png" alt="" width="766" height="339" class="aligncenter size-full wp-image-7245" srcset="https://blog.andreev.it/wp-content/uploads/2015/03/P051-21.png 766w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-21-300x133.png 300w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-21-585x259.png 585w" sizes="(max-width: 766px) 100vw, 766px" /></a></p>
<p>In the <strong>General Information</strong> section, enter the external IP of the Amazon&#8217;s gateway. If you open the configuration file that you downloaded, you can find that information there as well. Ignore 169.254. addresses.</p>
<pre class="brush: plain; title: ; notranslate">
The Customer Gateway inside IP address should be configured on your tunnel
interface. 

Outside IP Addresses:
  - Customer Gateway 		        : 104.207.133.238 
  - Virtual Private Gateway	        : 207.171.167.234
		
Inside IP Addresses
  - Customer Gateway         		: 169.254.255.38/30
  - Virtual Private Gateway             : 169.254.255.37/30

Configure your tunnel to fragment at the optimal size:
  - Tunnel interface MTU     : 1436 bytes
</pre>
<p>Make sure that you have a small table like this, so you don&#8217;t get confused with subnets and IPs.</p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2015/03/P051-22.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2015/03/P051-22.png" alt="" width="504" height="95" class="aligncenter size-full wp-image-7246" srcset="https://blog.andreev.it/wp-content/uploads/2015/03/P051-22.png 504w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-22-300x57.png 300w" sizes="(max-width: 504px) 100vw, 504px" /></a></p>
<p>For <strong>Phase 1</strong> section, enter the <strong>Pre-Shared Key</strong> and change the <strong>Encryption algorithm</strong> to 128 bits.</p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2015/03/P051-23.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2015/03/P051-23.png" alt="" width="627" height="434" class="aligncenter size-full wp-image-7247" srcset="https://blog.andreev.it/wp-content/uploads/2015/03/P051-23.png 627w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-23-300x208.png 300w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-23-585x405.png 585w" sizes="(max-width: 627px) 100vw, 627px" /></a></p>
<div style="border:1px solid red; padding:16px;">
<p style="text-align:center;"><strong><span style="color:#800000;">IMPORTANT</span> </strong></p>
<p>Make sure that you have correct values paired for both gateways. Pre-shared keys are different for the two gateway IPs on Amazon&#8217;s side.</p>
</div>
<p>Finally, in the <strong>Advanced Options</strong> section, change the parameter for <strong>Dead Peer Detection </strong>from 5 to 3 retries and click <strong>Save</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2015/03/P051-24.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2015/03/P051-24.png" alt="" width="726" height="348" class="aligncenter size-full wp-image-7248" srcset="https://blog.andreev.it/wp-content/uploads/2015/03/P051-24.png 726w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-24-300x144.png 300w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-24-585x280.png 585w" sizes="(max-width: 726px) 100vw, 726px" /></a></p>
<p>Click the &#8220;<strong>+</strong>&#8221; sign for <strong>Phase 2</strong>.</p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2015/03/P051-25.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2015/03/P051-25.png" alt="" width="716" height="291" class="aligncenter size-full wp-image-7249" srcset="https://blog.andreev.it/wp-content/uploads/2015/03/P051-25.png 716w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-25-300x122.png 300w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-25-585x238.png 585w" sizes="(max-width: 716px) 100vw, 716px" /></a></p>
<p>&#8230;and again the &#8220;<strong>+</strong>&#8221; sign for <strong>Phase 2</strong> entry.</p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2015/03/P051-26.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2015/03/P051-26.png" alt="" width="767" height="192" class="aligncenter size-full wp-image-7250" srcset="https://blog.andreev.it/wp-content/uploads/2015/03/P051-26.png 767w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-26-300x75.png 300w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-26-585x146.png 585w" sizes="(max-width: 767px) 100vw, 767px" /></a><br />
In the first section of <strong>Phase 2</strong>, add the local subnet on Amazon&#8217;s side (<strong>10.100.1.0</strong>).</p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2015/03/P051-27.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2015/03/P051-27.png" alt="" width="591" height="380" class="aligncenter size-full wp-image-7251" srcset="https://blog.andreev.it/wp-content/uploads/2015/03/P051-27.png 591w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-27-300x193.png 300w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-27-585x376.png 585w" sizes="(max-width: 591px) 100vw, 591px" /></a></p>
<p>In <strong>Phase 2 proposal </strong>section, change the value for <strong>AES</strong> to 128 bits and <strong>PFS key group </strong>to 2. Click <strong>Save</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2015/03/P051-28.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2015/03/P051-28.png" alt="" width="569" height="582" class="aligncenter size-full wp-image-7252" srcset="https://blog.andreev.it/wp-content/uploads/2015/03/P051-28.png 569w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-28-293x300.png 293w" sizes="(max-width: 569px) 100vw, 569px" /></a><br />
From the menu, go to <strong>Status | IPsec</strong>.</p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2015/03/P051-29.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2015/03/P051-29.png" alt="" width="596" height="357" class="aligncenter size-full wp-image-7253" srcset="https://blog.andreev.it/wp-content/uploads/2015/03/P051-29.png 596w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-29-300x180.png 300w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-29-585x350.png 585w" sizes="(max-width: 596px) 100vw, 596px" /></a></p>
<p>And you should see that the tunnel has been established.</p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2015/03/P051-30.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2015/03/P051-30.png" alt="" width="819" height="236" class="aligncenter size-full wp-image-7254" srcset="https://blog.andreev.it/wp-content/uploads/2015/03/P051-30.png 819w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-30-300x86.png 300w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-30-768x221.png 768w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-30-585x169.png 585w" sizes="(max-width: 819px) 100vw, 819px" /></a></p>
<h1>AWS routing</h1>
<p>Go on the Amazon side, click <strong>VPN Connections</strong> and verify that the tunnel is up too.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2015/03/P051-31.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2015/03/P051-31.png" alt="" width="768" height="340" class="aligncenter size-full wp-image-7255" srcset="https://blog.andreev.it/wp-content/uploads/2015/03/P051-31.png 768w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-31-300x133.png 300w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-31-585x259.png 585w" sizes="(max-width: 768px) 100vw, 768px" /></a></p>
<p>While there, click on the <strong>Route Tables </strong>on the right, then select your <strong>Private Subnet</strong>. Under <strong>Routes</strong> tab, see if pfSense local subnet is there and that it says <strong>Propagated</strong>. If not, go back to <strong>VPN Connections</strong>, then <strong>Static Routes</strong> and click <strong>Edit</strong>. Add <strong>10.99.0.0/16</strong>. Wait until <strong>Pending</strong> becomes <strong>Available </strong>(usually 5-10) seconds.</p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2015/03/P051-32.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2015/03/P051-32.png" alt="" width="611" height="273" class="aligncenter size-full wp-image-7256" srcset="https://blog.andreev.it/wp-content/uploads/2015/03/P051-32.png 611w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-32-300x134.png 300w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-32-585x261.png 585w" sizes="(max-width: 611px) 100vw, 611px" /></a></p>
<p>Then, go to the <strong>Route Tables </strong>, tab <strong>Routes</strong> and see if the route propagated successfully for the Private Route (in my case it&#8217;s <strong>BLOG Private Route</strong>).<br />
<a href="https://blog.andreev.it/wp-content/uploads/2015/03/P051-33.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2015/03/P051-33.png" alt="" width="558" height="327" class="aligncenter size-full wp-image-7257" srcset="https://blog.andreev.it/wp-content/uploads/2015/03/P051-33.png 558w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-33-300x176.png 300w" sizes="(max-width: 558px) 100vw, 558px" /></a><br />
If the <strong>10.99.0.0</strong> (pfSense LAN) route is not there, click on <strong>Route Propagation </strong>tab and make sure that the setting for route propagation is set to <strong>Yes</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2015/03/P051-34.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2015/03/P051-34.png" alt="" width="592" height="204" class="aligncenter size-full wp-image-7258" srcset="https://blog.andreev.it/wp-content/uploads/2015/03/P051-34.png 592w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-34-300x103.png 300w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-34-585x202.png 585w" sizes="(max-width: 592px) 100vw, 592px" /></a></p>
<h1>pfSense routing</h1>
<p>In order to access our instance at Amazon, we have to add a new route.  Go back to pfSense and click on <strong>System | Routing</strong>.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2015/03/P051-35.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2015/03/P051-35.png" alt="" width="242" height="193" class="aligncenter size-full wp-image-7259" /></a><br />
On the <strong>Gateway</strong> tab, click the &#8220;<strong>+</strong>&#8221; sign.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2015/03/P051-36.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2015/03/P051-36.png" alt="" width="773" height="255" class="aligncenter size-full wp-image-7260" srcset="https://blog.andreev.it/wp-content/uploads/2015/03/P051-36.png 773w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-36-300x99.png 300w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-36-768x253.png 768w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-36-585x193.png 585w" sizes="(max-width: 773px) 100vw, 773px" /></a></p>
<p>Change the interface to LAN, name the gateway (in my case <strong>GW2AWS</strong>), enter the GW IP (that&#8217;s the local pfSense LAN IP, in my case <strong>10.99.0.11</strong>) and click <strong>Save</strong>.</p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2015/03/P051-37.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2015/03/P051-37.png" alt="" width="643" height="585" class="aligncenter size-full wp-image-7261" srcset="https://blog.andreev.it/wp-content/uploads/2015/03/P051-37.png 643w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-37-300x273.png 300w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-37-585x532.png 585w" sizes="(max-width: 643px) 100vw, 643px" /></a></p>
<p>Click the <strong>Routes</strong> tab and then the &#8220;<strong>+</strong>&#8221; sign. Add a new route. Make sure you choose the gateway that we just created. The destination network should be <strong>10.100.1.0/24</strong>. Click <strong>Save</strong>.</p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2015/03/P051-38.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2015/03/P051-38.png" alt="" width="650" height="330" class="aligncenter size-full wp-image-7262" srcset="https://blog.andreev.it/wp-content/uploads/2015/03/P051-38.png 650w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-38-300x152.png 300w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-38-585x297.png 585w" sizes="(max-width: 650px) 100vw, 650px" /></a></p>
<p>Finally, go to <strong>Diagnostics | Routes </strong>and wait for the routes to show up. In my case it looks like this. Verify that you have the route between pfSense local subnet and AWS local subnet.</p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2015/03/P051-39.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2015/03/P051-39.png" alt="" width="658" height="306" class="aligncenter size-full wp-image-7263" srcset="https://blog.andreev.it/wp-content/uploads/2015/03/P051-39.png 658w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-39-300x140.png 300w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-39-585x272.png 585w" sizes="(max-width: 658px) 100vw, 658px" /></a></p>
<h1>Testing</h1>
<p>Since both pfSense and the AMIs are quite locked, we won&#8217;t have much choice in the testing scenarios. We know that ssh port is open on the AMIs, so go to the pfSense console and choose option 8 for shell access. There do:</p>
<pre class="brush: bash; title: ; notranslate">
ssh 10.100.1.136
</pre>
<p>If you receive something like this, you are good.</p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2015/03/P051-40.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2015/03/P051-40.png" alt="" width="698" height="86" class="aligncenter size-full wp-image-7264" srcset="https://blog.andreev.it/wp-content/uploads/2015/03/P051-40.png 698w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-40-300x37.png 300w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-40-585x72.png 585w" sizes="(max-width: 698px) 100vw, 698px" /></a></p>
<p>Now, pfSense is very-very locked by default. It doesn&#8217;t accept ssh and https is very limited to specific IPs. But, we can create a temp rule, just for the test. Go to <strong>Firewall | Rules</strong>, select the <strong>IPsec</strong> tab and create a rule to pass ICMP traffic as below.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2015/03/P051-41.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2015/03/P051-41.png" alt="" width="551" height="515" class="aligncenter size-full wp-image-7265" srcset="https://blog.andreev.it/wp-content/uploads/2015/03/P051-41.png 551w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-41-300x280.png 300w" sizes="(max-width: 551px) 100vw, 551px" /></a></p>
<p>Go back to the Amazon AMI and do:</p>
<pre class="brush: bash; title: ; notranslate">
ping 10.99.0.11
</pre>
<p>You should get a response from the pfSense box.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2015/03/P051-42.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2015/03/P051-42.png" alt="" width="455" height="211" class="aligncenter size-full wp-image-7266" srcset="https://blog.andreev.it/wp-content/uploads/2015/03/P051-42.png 455w, https://blog.andreev.it/wp-content/uploads/2015/03/P051-42-300x139.png 300w" sizes="(max-width: 455px) 100vw, 455px" /></a></p>
<p>If you made it congrats, now you have full site to site connection. It&#8217;s up to you how you want to configure the firewall rules on pfSense side or security groups on Amazon&#8217;s side. </p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.andreev.it/2015/03/pfsense-2-2-amazon-aws-site-to-site/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
	</channel>
</rss>
