<div dir="ltr">Thank you Paul! I've modified my configuration to define the elastic IP as the `leftsubnet` parameter (with `/32` at the end of it) as well as define `%defaultroute` for the `left` parameter, and the tunnel is established, although I'm still unable to ping. When I run `ip xfrm monitor` while pinging (no ping packets returned), no output is returned. <div><br></div><div>Would you have any suggestions as to how I can debug further?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 6, 2016 at 9:43 AM, Paul Wouters <span dir="ltr"><<a href="mailto:paul@nohats.ca" target="_blank">paul@nohats.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tue, 6 Dec 2016, Brandon Galbraith wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I'm attempting to create a connection from an AWS EC2 instance (running LibreSwan) to a Juniper SRX240. The SRX240 VPN<br>
endpoint has a public IP, and the subnet I'm attempting to route to over the encrypted VPN connection is a public IP. The<br>
EC2 instance has a private IP within a VPC, but has an elastic IP assigned to it.<br>
Due to limitations on the remote network, RFC1918 network address space can't be routed over the IPsec tunnel.<br>
The connection looks like such with `ipsec auto --status`:<br>
<br>
192.168.204.177<192.168.204.17<wbr>7>[xx.xx.xx.xxx (elastic IP in<br>
VPC)]...vpn-terminator-public-<wbr>ip<vpn-terminator-pubic-ip>==<<wbr>public host ip>/32<br>
<br>
I'm able to successfully establish IPsec SA and ISAKMP SA sessions with the destination VPN terminator endpoint, but I'm<br>
unable to ping across the tunnel; the firewall policy on the other side of the tunnel is restricting source packets to be<br>
from the elastic IP of the EC2 instance (again, due to RFC1918 space being unroutable for VPN tunnel purposes).<br>
</blockquote>
<br></span>
You need to configure the elastic IP on your VPS, so that the operating<br>
system can use it as source ip address. This is described at:<br>
<br>
<a href="https://libreswan.org/wiki/Int">https://libreswan.org/wiki/Int</a><wbr>eroperability#The_elastic_IP_<wbr>and_the_RFC1918_native_IP_addr<wbr>ess<br>
<br>
(if your VPS is ubuntu/debian, you will have to change /etc/network/interfaces similarly)<br>
<br>
I've just clarified the above wiki entry, and also updated the AWS example config:<br>
<br>
<a href="https://libreswan.org/wiki/Int">https://libreswan.org/wiki/Int</a><wbr>eroperability#Example_configur<wbr>ation<br>
<br>
But basically:<span class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
conn tunnel1<br>
<br>
        authby=secret<br>
        auto=start<br>
        left=192.168.204.177<br>
        leftid=<elastic ip><br>
        #leftsubnet=<a href="http://192.168.204.0/22">192.168.204.0/22</a><br>
</blockquote>
<br></span>
So change that to leftsubnet=<elastic ip>/32<span class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Is this type of connection possible from within an AWS VPC?<br>
</blockquote>
<br></span>
It is!<span class="HOEnZb"><font color="#888888"><br>
<br>
Paul<br>
</font></span></blockquote></div><br></div>