<div dir="ltr"><div>Thank you for your answers, I'll try to be more explicit about my needs.<br><br></div>I need to do two configurations :<br><p>VPN Client: 172.16.0.3 - 1.1.1.1 - INTERNET - 2.2.2.2 - Firewall- <a href="http://172.16.1.0/24">172.16.1.0/24</a><br></p><p>Mode Config : 172.16.0.32-64 - 1.1.1.1 - INTERNET - 2.2.2.2 - Firewall - <a href="http://172.16.1.0/24">172.16.1.0/24</a><br></p>Here my ipsec.conf :<br><br>config setup<br><br>conn %default<br>        dpddelay=30<br>        keyingtries=5<br>        rekeymargin=120<br>        dpdtimeout=15<br>        keyexchange=ikev1<br>        keylife=1h<br>        ikelifetime=6h<br>        authby=rsasig<br><br>conn normal<br>        right=2.2.2.2<br>        rightsubnet=<a href="http://172.16.1.0/24">172.16.1.0/24</a><br>        rightid=%any<br><br>        left=%defaultroute<br>        leftsubnet=<a href="http://172.16.0.3/32">172.16.0.3/32</a><br>        leftsourceip=172.16.0.3<br>        leftcert=cert.pem<br>        leftca=cacert.pem<br>        leftsendcert=always<br><br>        auto=route<br>        type=tunnel<br>        ike=aes256-sha2_256-modp1536<br>        esp=aes256-sha2_256-modp1024<br><br>conn cfgconf<br>        right=2.2.2.2<br>        rightsubnet=<a href="http://172.16.1.0/24">172.16.1.0/24</a><br>        rightid=%any<br><br>        left=%defaultroute<br>        leftsourceip=%modeconfig<br>        leftcert=cert.pem<br>        leftca=cacert.pem<br>        leftrsasigkey=%cert<br>        leftsendcert=always<br><br>        auto=route<br>        type=tunnel<br>        ike=aes256-sha2_256-modp1536<br>        esp=aes256-sha2_256-modp1024<br><div><br><br></div><div>strongswan.conf :<br><br>charon {<br>        load_modular          = yes<br>        install_virtual_ip      = yes<br>        install_routes          = yes<br>        plugins {<br>                include strongswan.d/charon/*.conf<br>        }<br>}<br><br>include strongswan.d/*.conf<br><br>I have problems with these two configurations:<br><br></div><div>For the first:<br></div><div>-Strongswan doesnt create a virtual IP address 172.16.0.3 but a virtual IP address in config mode subnet even if I remove the cfgconf from ipsec.conf. So when I do "ip a show eth1" I got 172.16.0.33 instead of 172.16.0.3 (but when I check my configuration with ipsec statusall It gives me : normal{1}:   <a href="http://172.16.0.3/32">172.16.0.3/32</a> === <a href="http://172.16.1.0/24">172.16.1.0/24</a> . So, is strongswan supposed to make virtual IP address for non config connection ?<br></div><div><br></div><div>For the second:<br></div><div>-All works fine if I don't want to use traffic detection mode. Indead, if I want my tunnel to be opened with traffic detection, I need to specify auto=route but my tunnel is in config mode so the routing doesn't seem to work (howover, when I open my tunnel with auto=start, all works fine). So, is there any way to pass throught this problem ? Is it possible tu use traffic detection without initial routing ?<br><br></div><div>For boths:<br></div><div>-I'm using virtual IP address because I do roadwarrior configurations, so when I unplug a network wire, these virtual IP addresses are erased, so I'd need either virtual addresses which are not erased when the wire is unpluged or tunnels to be closed when the wire is unpluged (in order to have the virtual IP address recreated after the wire to be replug).<br><br></div><div>Thanks for helping<br></div><div class="gmail_extra"><br><div class="gmail_quote">2015-04-29 7:55 GMT+02:00 Noel Kuntze <span dir="ltr"><<a href="mailto:noel@familie-kuntze.de" target="_blank">noel@familie-kuntze.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA256<br>
<br>
Hello Jacques,<br>
<br>
Do you have logs? I would like to see what strongSwan does and your operating system in particular,<br>
as you do not use DPD, so a connection failure should not be detected and the policies and the tunnel state should remain up,<br>
although no communication is possible. If this is wanted, is yours to decide.<br>
<br>
Also, if your ultimate goal is to avoid leaking traffic, look at the "policy" match in iptables<br>
and make creative use of it in *filter FORWARD.<br>
<br>
Mit freundlichen Grüßen/Kind Regards,<br>
Noel Kuntze<br>
<br>
GPG Key ID: 0x63EC6658<br>
Fingerprint: 23CA BB60 2146 05E7 7278 6592 3839 298F 63EC 6658<br>
<span class=""><br>
Am 28.04.2015 um 11:19 schrieb Jacques Monin:<br>
> Hello,<br>
><br>
> I'm trying to configurate strongswan in order to have automatic tunnel opening and routing.<br>
><br>
> The tunnel opens well on traffic detection, the routes are created and all works well. But if a network wire is unpluged, the routing is erased and I have to restart strongswan.<br>
> Is there any way to avoid this ?<br>
><br>
> Is this possible to have the routing and the virtual addresse adding done while the opening of the tunnel ?<br>
> By using leftupdown="ipsec _updown"<br>
><br>
> It seems that the only option to have automatic tunnel opening is to specify auto=route in ipsec.conf (I was hoping auto=add had the same behaviour).<br>
> So is there any way to have automatic tunnel opening without initial routing ?<br>
><br>
> Here my configuration :<br>
><br>
> config setup<br>
><br>
> conn %default<br>
>         dpddelay=30<br>
>         keyingtries=5<br>
>         rekeymargin=120<br>
>         dpdtimeout=120<br>
>         keyexchange=ikev1<br>
>         keylife=1h<br>
>         ikelifetime=6h<br>
>         authby=rsasig<br>
><br>
> conn Visio<br>
>         right=A.A.A.A<br>
</span>>         rightsubnet=<a href="http://172.16.1.0/24" target="_blank">172.16.1.0/24</a> <<a href="http://172.16.1.0/24" target="_blank">http://172.16.1.0/24</a>><br>
>         rightid=%any<br>
><br>
>         left=%defaultroute<br>
>         leftsubnet=<a href="http://172.16.0.3/32" target="_blank">172.16.0.3/32</a> <<a href="http://172.16.0.3/32" target="_blank">http://172.16.0.3/32</a>><br>
<span class="">>         leftsourceip=172.16.0.3<br>
>         leftcert=cert.pem<br>
>         leftca=cacert.pem<br>
>         leftsendcert=always<br>
><br>
>         auto=route<br>
>         type=tunnel<br>
>         ike=aes256-sha2_256-modp1536<br>
>         esp=aes256-sha2_256-modp1024<br>
><br>
> Thanks for you help<br>
><br>
><br>
</span>> _______________________________________________<br>
> Users mailing list<br>
> <a href="mailto:Users@lists.strongswan.org">Users@lists.strongswan.org</a><br>
> <a href="https://lists.strongswan.org/mailman/listinfo/users" target="_blank">https://lists.strongswan.org/mailman/listinfo/users</a><br>
<br>
-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v2<br>
<br>
iQIcBAEBCAAGBQJVQHJHAAoJEDg5KY9j7GZYnXUP/RxP9P/jWjS+r9toiM0sHyWj<br>
hr5YQYjDfU/XdhpVWgMmvelVOYd0Frd52pf/k3+VJ1uWFwqwJUOjrg1N33ovAVt+<br>
Lusp5xlEBMIDnDb7raPEsE1yGNreFwKKJIROmnwWlhlnh2HDC4g6Ke6leFX4rjyp<br>
pFEuzKm5MwYv3+E2X6i8MoqRQXVPudnL5ZZPXmQ/xwzn+BesH+uMHfhWzXR67uo5<br>
KiH9V2HqoHAggd3MiOA8wsYOoxD7bydoa4Y6dIJfDijCK58W+2t1Wu/XRpLrwSem<br>
Qfy2yGlB+rQGoLGX6lcx8V87bdkX2khS5jik/KffapWU0i7cqcA8Zy5KQRek5y95<br>
f6ruI+QWRu1pENj5ciVyAPGy3cuGJLaIWSjvUFdkiprmL3iaXbRQ9/tlnb4C1Up7<br>
48MFGffEVAk7niomsU1l8mBQNrJRDDC0Lr6vK/V0vXutT0lP8qyQEduGZ4U+8u2L<br>
XV+saUX8wd9LJ1MCm8Db5szHQEasNmck6OzboYMK5UDQapMmXQ98OgUqYOq3wqSO<br>
8aP1C9g42smlqnV0IGnbWCaJ76PwwGNlLyFyTmKBFQPfRinVeyl893wHUyLs59kd<br>
QEwsjMrBNaQjWjNhFlf1e596Q0ik/jYpjSCYnWf8VDxLEYtWou2O0BFyrz5BIT9Q<br>
8rnXlGzABj2VQehkRUdY<br>
=h2ws<br>
-----END PGP SIGNATURE-----<br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.strongswan.org">Users@lists.strongswan.org</a><br>
<a href="https://lists.strongswan.org/mailman/listinfo/users" target="_blank">https://lists.strongswan.org/mailman/listinfo/users</a></blockquote></div><br></div></div>