<html><body>
    <br />
    <br />
    Hi Paul<BR>
<BR>
Thanks for this.  I have it working ðŸ˜Š<BR>
<BR>
Regards<BR>
<BR>
Matt<BR>
-----Original Message-----<BR>
From: Paul Wouters [mailto:paul@nohats.ca] <BR>
Sent: 14 December 2017 19:53<BR>
To: Matt Dennison <Matt.Dennison@tribalgroup.com><BR>
Cc: <a href="mailto:swan@lists.libreswan.org">swan@lists.libreswan.org</a><BR>
Subject: Re: [Swan] LibreSwan - Transport Mode, Secure Only by Multiple IP Addresses<BR>
<BR>
On Thu, 14 Dec 2017, Matt Dennison wrote:<BR>
<BR>
> I am attempting to secure traffic between a LibreSwan host and <BR>
> multiple dynamic Windows hosts.  If I specify a single right host as <BR>
> shown in the configuration below it works as expected, in that <BR>
> security is required.  However, if I change to a IP range or %any, security is now only optional.  I need to change this behaviour so security is required.  I have not been able to figure out how to enforce this change in behaviour, can anyone help?<BR>
<BR>
When using right=%any, you cannot use auto=start, because you do not know where "any" is. So the other endpoints need to initiate to you.<BR>
<BR>
If you want to avoid leaking unencrypted packets before those endpoints initiate you, you can either an iptables or an ipsec based block rule.<BR>
<BR>
Using iptables:<BR>
<BR>
iptables -A OUTPUT -s 192.168.10.130/32 -d 192.168.10.127/30 -m policy --dir out --pol ipsec -j ACCEPT iptables -A OUTPUT -s 192.168.10.130/32 -d 192.168.10.127/30 -m policy --dir out --pol none -j DROP<BR>
<BR>
To do the same within ipsec, you could do:<BR>
<BR>
conn block-plain<BR>
        left=192.168.10.130<BR>
        right=%any<BR>
        rightsubnet=192.168.10.127/30<BR>
        type=drop<BR>
        authby=never<BR>
        auto=route<BR>
        # low priority so tunnels win when up<BR>
        priority=6000<BR>
<BR>
Paul<BR>
<BR>
> conn main<BR>
> type=transport<BR>
> authby=secret<BR>
> left=192.168.10.130<BR>
> right=192.168.10.128<BR>
> # right=192.168.10.127-192.168.10.129<BR>
> # right=%any<BR>
> pfs=yes<BR>
> ike=3des-sha1;modp1024<BR>
> phase2=esp<BR>
> auto=start<BR>
> <BR>
>  <BR>
> <BR>
> Thanks<BR>
> <BR>
>  <BR>
> <BR>
> Matt<BR>


    <br />
<span style="font-family:Calibri; Font-size:9.0pt">
***************************<br />
<i>Information contained in this e-mail is intended for the use of the addressee only, is confidential and may be the subject of Legal Professional Privilege. Any dissemination, distribution, copying or use of this communication without our prior permission or that of the addressee is strictly prohibited.<br />
The contents of an attachment to this e-mail may contain software viruses, which could damage your own computer system. While Tribal has taken every reasonable precaution to minimise this risk, we cannot accept liability for any damage which you sustain as a result of software viruses. You should carry out your own virus checks before opening the attachment.
    
    <br />
   
    
</i></span></body></html>