<div dir="ltr"><div>Tobias,<br><br></div><div class="gmail_extra"><div class="gmail_quote">On Thu, Jul 16, 2015 at 8:56 AM, Tobias Brunner <span dir="ltr"><<a href="mailto:tobias@strongswan.org" target="_blank">tobias@strongswan.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Stuart,<br>
<span><br>
> I've been looking at adding support for subnets when using transport<br>
> mode. In our use case, it will be far more efficient to allow users to<br>
> specify<br>
>     right=<a href="http://192.168.1.128/25" rel="noreferrer" target="_blank">192.168.1.128/25</a><br>
> instead of having to create a separate connection config for each host.<br>
> It appears that there has been some prior interest and work in this area:<br>
>   <a href="https://wiki.strongswan.org/issues/196" rel="noreferrer" target="_blank">https://wiki.strongswan.org/issues/196</a><br>
<br>
</span>I've updated the trap-any branch (based on the trap-acquire-tracking<br>
branch).  Due to the changes in 5.3.0 (reqids don't identify CHILD_SAs<br>
anymore) no additional reqids are required and no awkward SA deletion is<br>
needed anymore.  So that removes one of the reservations I had about the<br>
previous iteration of the patch.<br>
<br>
And with the above patch it is actually already possible to limit the<br>
remote hosts to specific subnets/IPs.  Just set `rightsubnet`<br>
accordingly.  I added a test scenario (ikev2/trap-any) in that branch<br>
that illustrates this (see host dave).<br>
<br>
Let me know if that works for you.<br>
<br></blockquote><br></div>Tobias,<br><br></div><div class="gmail_extra">Thanks for the update; that works for our use case. I've tried the updated trap-any branch, and it works well (in very limited testing) so far with one caveat. If you specify<br></div><div class="gmail_extra">  right=%any<br></div><div class="gmail_extra">  rightsubnet=<a href="http://192.168.0.0/30" target="_blank">192.168.0.0/30</a><br></div><div class="gmail_extra">then things work as expected. If the administrator uses<br></div><div class="gmail_extra">  right=<a href="http://192.168.0.0/30" target="_blank">192.168.0.0/30</a> <br></div><div class="gmail_extra">however, the proposed traffic selector is <a href="http://0.0.0.0/0" target="_blank">0.0.0.0/0</a> for both sides instead of <a href="http://192.168.0.0/30" target="_blank">192.168.0.0/30</a>. This blocks traffic to *all* hosts, not just the selected range, and leads to charon trying to initiate IKE even with hosts that are not in the specified range.<br><br>This could be construed as a misconfiguration, but my reading of the documentation implies that it is valid to specify a range for right. I implemented a solution in my earlier patch, and can update it if needed to base off this branch. The basic fix I went with was to catch the substitution of any for the actual subnet in the trap_manager install method, and use the subnet for the traffic selector later.<br><br></div><div class="gmail_extra">Thanks,<br><br></div><div class="gmail_extra">-- Stuart<br></div><div class="gmail_extra"><br></div></div>