<div dir="ltr"><div dir="ltr">Hi Paul,<div><br></div><div>Thank you for the confirmation!<br></div><div>We were following an example from here: <a href="https://libreswan.org/wiki/HOWTO:_Opportunistic_IPsec">https://libreswan.org/wiki/HOWTO:_Opportunistic_IPsec</a> (3.3 Assign networks).</div><div><br></div><div>Without the priority override it defaults to clear for all connections, so priority was just an attempt to find a workaround (other than not to specify 0/0)<br></div><div><br></div><div>Kirill.</div></div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Nov 15, 2018 at 9:51 AM Paul Wouters <<a href="mailto:paul@nohats.ca" target="_blank">paul@nohats.ca</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Thu, 15 Nov 2018, Kirill Logachev wrote:<br>
<br>
> We were trying to configure LibreSwan opportunistic IPSec in a cluster with the next configuration.<br>
>       conn private                                                           <br>
<br>
> conn clear                                                             <br>
>         left=%defaultroute                                             <br>
>         right=%group                                                   <br>
>         type=passthrough                                               <br>
>         auto=route<br>
>               priority=65535                        <br>
<br>
I strongly recommend not setting a priority. OE requires some careful<br>
priorities, especially if using it with protocol and port selectors.<br>
<br>
> IP ranges configurations:<br>
>       [root@vm0 ipsec.d]# cat policies/clear<br>
> <a href="http://0.0.0.0/0" rel="noreferrer" target="_blank">0.0.0.0/0</a><br>
<br>
Don't put 0/0 in the clear group. Just leave it empty. Think of the clear<br>
group as a special override forbidding ipsec.<br>
<br>
> [root@vm0 ipsec.d]# cat policies/private<br>
> <a href="http://10.0.0.0/24" rel="noreferrer" target="_blank">10.0.0.0/24</a>                             <br>
<br>
So if you wanted only 10.0.0.13 to be in the clear, you would add that<br>
to the clear group. But for 1.2.3.4 you just want it to match no OE<br>
group, or you put 0/0 in the clear-or-private group, meaning it will<br>
go out in the clear but if others try IKE to you, you will accept it.<br>
<br>
> The expectation is: IPSec is enforced in the cluster subnet & clear is allowed for everything else.First, we didn't set a priority, but clear connection has<br>
> higher priority than private in that case.<br>
> When we lower clear priority, libreswan fails to establish a tunnel.<br>
<br>
Paul<br>
</blockquote></div>