<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Thanks for the quick response!</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">1) I am definitely aiming for the "enterprise mesh" deployment, so it sounds like symmetric auth is the right way to go.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">2) I went ahead and removed the "interfaces" line to keep things clean.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">3) No problem - I'm using Ansible to deploy anyway, so it's not a huge deal to specify the network interface in the "left" field in oe-certificate.conf.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">I am indeed using libreswan 3.25; here's my CentOS version, in case that's relevant:</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">/etc/centos-release:</p>
<p style="margin-top:0;margin-bottom:0">------</p>
<p style="margin-top:0;margin-bottom:0"><span>CentOS Linux release 7.6.1810 (Core)</span></p>
<p style="margin-top:0;margin-bottom:0"><span>------</span></p>
<p style="margin-top:0;margin-bottom:0"><span><br>
</span></p>
<p style="margin-top:0;margin-bottom:0"><span>Here are the logs after running with plutodebug=all:</span></p>
<p style="margin-top:0;margin-bottom:0"><span><br>
</span></p>
<p style="margin-top:0;margin-bottom:0">192.168.50.3 (ping originator): <a href="https://pastebin.com/iS6ws1VF" class="OWAAutoLink" id="LPlnk36281" previewremoved="true">https://pastebin.com/iS6ws1VF</a></p>
<br>
<p style="margin-top:0;margin-bottom:0">192.168.50.2 (ping target): <a href="https://pastebin.com/U5YGJijH" class="OWAAutoLink" id="LPlnk764436" previewremoved="true">https://pastebin.com/U5YGJijH</a></p>
<br>
<div>Thanks again,</div>
<div><br>
</div>
<div>-Jonathan</div>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Paul Wouters <paul@nohats.ca><br>
<b>Sent:</b> Friday, December 7, 2018 7:15:35 AM<br>
<b>To:</b> Jonathan Thompson<br>
<b>Cc:</b> swan@lists.libreswan.org<br>
<b>Subject:</b> Re: [Swan] Opportunistic Encryption in VirtualBox</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">On Fri, 7 Dec 2018, Jonathan Thompson wrote:<br>
<br>
> I'm working on setting up a libreswan testbed in VirtualBox with two virtual machines utilizing opportunistic<br>
> encryption. I'm following the guide here: <a href="https://libreswan.org/wiki/HOWTO:_Opportunistic_IPsec">https://libreswan.org/wiki/HOWTO:_Opportunistic_IPsec</a><br>
<br>
> 1) Both "rightauth" and "leftauth" need to be set to "rsasig" in /etc/ipsec.d/oe-certificate.conf.<br>
<br>
that really depends on what kind of Opportunistic you want. If this is<br>
for the "enterprise mesh" kind of deployment, then yes it is usually<br>
symmetric and you can use authby=rsasig without using<br>
leftauth/rightauth.<br>
<br>
If you want to support anonymous connections to servers (eg<br>
Opportunistic on public internet servers) then you use asymmetric<br>
authentication where the client uses authnull.<br>
<br>
> 2) In VirtualBox, I'm using an internal network to connect the two machines which isn't exposed to the host<br>
> machine. Since the default route for VirtualBox VMs is eth0, I had to configure IPSec to run on the eth1<br>
> interface by specifying 'interfaces="ipsec0=eth1"'.<br>
<br>
That looks suspicious. I assume you are not using the KLIPS IPsec stack<br>
but the buildin XFRM/NETKEY IPsec stack, and then the interfaces= line<br>
is ignored.<br>
<br>
> 3) Since I'm using a network interface other than the %defaultroute, it seems I had to manually set "left=<eth1<br>
> ip>" in oe-certificate.conf. Is there a more elegant way to accomplish this? (like, a %ipsec0 magic, which I<br>
> tried out of curiosity but didn't work. Couldn't find more documentation on that.).<br>
<br>
Unfortunately, that is probably the only workaround for that right now.<br>
<br>
> Once that's all done and ipsec is restarted, I ping one machine from the other, and get the following result in<br>
> the pluto logs:<br>
<br>
> Dec  7 00:16:04.780176: "private#192.168.50.0/24"[1] ...192.168.50.3 #1: switched from<br>
> "private#192.168.50.0/24"[1] ...192.168.50.3 to "private#192.168.50.0/24"<br>
<br>
Hmm it is switching from the instance of the template back to the<br>
template, which seems wrong. Is this an older version of libreswan?<br>
Please use at least 3.25. (odd that is what you are using it seems)<br>
<br>
> Dec  7 00:16:04.781855: "private#192.168.50.0/24"[2] ...192.168.50.3===? #1: certificate verified OK:<br>
> CN=192.168.50.3,*************<br>
> Dec  7 00:16:04.782210: "private#192.168.50.0/24"[2] ...192.168.50.3===? #1: Authenticated using RSA<br>
> Dec  7 00:16:04.785707: "private#192.168.50.0/24"[2] ...192.168.50.3===? #1: responding to AUTH message (ID 1)<br>
> from 192.168.50.3:500 with encrypted notification AUTHENTICATION_FAILED<br>
<br>
It's odd it authenticated and then entered the failure path. Perhaps<br>
rerun with plutodebug=all to see what's going on? But I suspect an<br>
older (broken) version....<br>
<br>
> Dec  7 00:16:04.784864: "private#192.168.50.0/24"[1] ...192.168.50.2 #1: responding to INFORMATIONAL message<br>
> (ID 0) from 192.168.50.2:500 with encrypted notification INVALID_IKE_SPI<br>
<br>
This just looks like one end restarted and some old messages are getting<br>
rejected.<br>
<br>
> I'm working from the base 'centos/7' Vagrant image. I can add the Vagrantfile I'm using as well.<br>
> <br>
> Thanks in advance! I'm hoping this is something super simple. Please let me know what other information I can<br>
> provide to help.<br>
<br>
Please add plutodebug=all and post the log somewhere so I can have a<br>
look at it.<br>
<br>
Paul<br>
</div>
</span></font></div>
</body>
</html>