<div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div><div>Hello!<br><br></div>I have a problem.<br><br></div>I need to start strongswan tunnel to remote server in a situation when the physical internet access (not the eth0 being formally "up" but actual ability to ping the server) may become available an unpredictable (and usually long, 8-12 seconds, but up to 40) time after the machine (re)boots<br><br></div>The config that works AFTER the server is pingable is as follows:<br>-----<br># ipsec.conf - strongSwan IPsec configuration file<br><br># basic configuration<br><br>config setup<br>Â Â Â # strictcrlpolicy=yes<br>Â Â Â # uniqueids = no<br><br># Add connections here.<br><br># Sample VPN connections omitted<br><br>conn hide<br>Â <br>Â forceencaps = yes <br>Â keyexchange=ikev2<br>Â keyingtries = %forever<br>Â dpdaction=clear<br>Â dpddelay=300s<br>Â eap_identity=REDACTED<br>Â leftauth=eap-mschapv2<br>Â left=%defaultroute<br>Â leftfirewall = yes<br>Â leftsourceip=%config<br>Â right=<a href="http://free-nl.hide.me">free-nl.hide.me</a><br>Â rightauth=pubkey<br>Â rightsubnet=<a href="http://0.0.0.0/0">0.0.0.0/0</a><br>Â rightid=%any<br>Â type=tunnel<br>Â auto=add<br><br><br>include /var/lib/strongswan/ipsec.conf.inc<br>-----<br><br></div>this one can be started by sudo ipsec up hide without issue, but ONLY after the server is already pingable.<br><br></div>Now, upon reading docs and googling, I decided to try replacing <br>Â auto=add<br></div>with <br>Â auto=route<br><br></div><div>(I did a full sudo ipsec restart after changing config)<br></div><div><br></div>This has not lead to a positive effect.<br></div>Even after connection is definitely working and server is pingable, absolutely no connection is established.<br></div>Even opening a browser on the machine and navigating somewhere does not trigger it. Waiting for a whole minute and outright downloading a 1 MB file still does not trigger it.<br><br></div>The machine is behind a NAT (as obvious from working config)<br><br></div>Platform is Debian 8<br><br></div>Please help :)<br></div>