<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<STYLE type=text/css> P, UL, OL, DL, DIR, MENU, PRE { margin: 0 auto;}</STYLE>

<META name=GENERATOR content="MSHTML 11.00.9600.17420"></HEAD>
<BODY leftMargin=1 rightMargin=1 topMargin=1>
<P><FONT size=2 face="Segoe UI">Hi there.<BR><BR>FYI, I have also posted this on Server Fault. I am trying to establish an ipsec VPN from a Draytek router on the edge of our corporate network to a VPS on Digital Ocean. I've set up the VPN on the VPS using this script - <A href="https://github.com/philplckthun/setup-simple-ipsec-l2tp-vpn"><FONT color=#0000ff>https://github.com/philplckthun/setup-simple-ipsec-l2tp-vpn</FONT></A>
 - on an Ubuntu 14.04 machine. I believe the script downloads and installs libreswan and prompts for a few basic configuration questions etc. I've made a few changes to the ipsec.conf the script creates. My problem is, I can ping from the router to the VPS and I can see the packets arriving on the VPS showing as coming from the private IP address of the router, but nothing I've tried has allowed me to route packets back down the tunnel to the router. Therefore, from the router's pov it appears the pings are timing out.<BR><BR>The router is connected directly to the internet on one of its interfaces and it is configured with a local IP address of 10.111.1.1. The VPS has a single interface connected directly to the internet.<BR><BR>When the VPN is established this is the routing table on the VPS:<BR><BR>Kernel IP routing table<BR>
Destination &nbsp;&nbsp;&nbsp;&nbsp;Gateway &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Genmask &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Flags &nbsp;&nbsp;MSS Window &nbsp;irtt Iface<BR>default &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;178.62.64.1 &nbsp;&nbsp;&nbsp;&nbsp;0.0.0.0 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;UG &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0 0 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0 eth0<BR>10.111.1.1 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;255.255.255.255 UH &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0 0 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0 eth0<BR>
178.62.64.0 &nbsp;&nbsp;&nbsp;&nbsp;* &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;255.255.192.0 &nbsp;&nbsp;U &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0 0 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0 eth0<BR><BR>Note the second entry is created when the VPN is established.<BR><BR>If I try to ping 10.111.1.1 I get:<BR><BR>PING 10.111.1.1 (10.111.1.1) 56(84) bytes of data.<BR>From &lt;public IP address - eth0&gt; icmp_seq=1 Destination Host Unreachable<BR><BR>Here is the output from ipsec verify:<BR><BR>Verifying installed system and configuration files<BR><BR>Version check and ipsec on-path &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[OK]<BR>Libreswan 3.10 (netkey) on 3.13.0-37-generic<BR>
Checking for IPsec support in kernel &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp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p;&nbsp;&nbsp;&nbsp;[N/A]<BR>Two or more interfaces found, checking IP forwarding &nbsp;&nbsp;&nbsp;[OK]<BR>Checking rp_filter &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[OK]<BR>
Checking that pluto is running &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[OK]<BR>Pluto listening for IKE on udp 500 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[OK]<BR>Pluto listening for IKE/NAT-T on udp 4500 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[OK]<BR>Pluto ipsec.secret syntax &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[OK]<BR>
Checking 'ip' command &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[OK]<BR>Checking 'iptables' command &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[OK]<BR>Checking 'prelink' command does not interfere with FIPSChecking for obsolete ipsec.conf options &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[OK]<BR>Opportunistic Encryption &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[DISABLED]<BR><BR>
and here is the content of /etc/ipsec.conf (the commented out lines are results of previous experimentation with the same results) - essentially, nothing I change seems to make any difference:<BR><BR>version 2.0<BR><BR>config setup<BR>&nbsp;dumpdir=/var/run/pluto/<BR>&nbsp;nat_traversal=yes<BR>&nbsp;virtual_private=%v4:10.0.0.0/8,%v4:192.168.0.0/16,%v4:172.16.0.0/12,%v4:!192.168.42.0/24<BR>&nbsp;oe=off<BR>&nbsp;protostack=netkey<BR>&nbsp;nhelpers=0<BR>&nbsp;interfaces=%defaultroute<BR><BR>conn vpnpsk<BR>&nbsp;connaddrfamily=ipv4<BR>&nbsp;auto=add<BR>&nbsp;left=178.62.73.215<BR># &nbsp;leftid=178.62.73.215<BR># &nbsp;leftsubnet=178.62.73.215/32<BR>&nbsp;leftsubnet=10.10.10.0/24<BR># &nbsp;leftnexthop=%defaultroute<BR>&nbsp;leftnexthop=%direct<BR>&nbsp;leftprotoport=17/1701<BR>&nbsp;rightprotoport=17/%any<BR># &nbsp;right=%any<BR>&nbsp;right=10.111.1.0/24<BR>
&nbsp;rightsourceip=10.111.1.1<BR>&nbsp;leftsourceip=10.10.10.1<BR># &nbsp;rightsubnetwithin=0.0.0.0/0<BR>&nbsp;forceencaps=yes<BR>&nbsp;authby=secret<BR>&nbsp;pfs=no<BR>&nbsp;type=transport<BR>&nbsp;auth=esp<BR>&nbsp;ike=3des-sha1,aes-sha1<BR>&nbsp;phase2alg=3des-sha1,aes-sha1<BR>&nbsp;rekey=no<BR>&nbsp;keyingtries=5<BR>&nbsp;dpddelay=30<BR>&nbsp;dpdtimeout=120<BR>&nbsp;dpdaction=clear<BR><BR>This is the relevant part of the routing table from the router:<BR><BR>Key: C - connected, S - static, R - RIP, * - default, ~ - private<BR>* &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.0.0.0/ 0.0.0.0 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;via &lt;public IP address&gt; &nbsp;&nbsp;WAN2<BR>S~ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;10.10.10.0/ 255.255.255.0 &nbsp;&nbsp;&nbsp;via 178.62.73.215 &nbsp;&nbsp;VPN-10<BR>
C~ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;10.111.1.0/ 255.255.255.0 &nbsp;&nbsp;&nbsp;directly connected &nbsp;&nbsp;&nbsp;LAN <BR>C &nbsp;&nbsp;&nbsp;&lt;public IP address&gt;/ 255.255.255.224 &nbsp;directly connected &nbsp;&nbsp;&nbsp;WAN2<BR><BR>Would appreciate someone pointing out what I'm doing wrong.<BR><BR>Many thanks.<BR></FONT></P><br clear="both">
______________________________________________________________________<BR>
This email has been scanned by the Symantec Email Security.cloud service.<BR>
For more information please visit http://www.symanteccloud.com<BR>
______________________________________________________________________<BR>
</BODY></HTML>