Mar 22 21:43:47 opnFW1 charon[16547]: 11[KNL] creating acquire job for policy 192.168.1.10/32 === 192.168.1.1/32 with reqid {1000}Mar 22 21:43:47 opnFW1 charon[16547]: 07[CFG] trap not found, unable to acquire reqid 1000Mar 22 21:44:19 opnFW1 charon[16547]: 07[KNL] creating acquire job for policy 192.168.1.10/32 === 192.168.1.1/32 with reqid {1000}Mar 22 21:44:19 opnFW1 charon[16547]: 11[CFG] trap not found, unable to acquire reqid 1000
root@opnFW1:~ # ifconfig ipsec1000ipsec1000: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> metric 0 mtu 1400 tunnel inet 192.168.1.10 --> 192.168.1.1 inet6 fe80::1a5a:58ff:fe10:13a0%ipsec1000 prefixlen 64 scopeid 0x13 inet 172.16.1.10 --> 172.16.1.1 netmask 0xffffffff groups: ipsec reqid: 1000 nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
root@opnFW1:~ # ping -c 2 192.168.1.1PING 192.168.1.1 (192.168.1.1): 56 data bytes64 bytes from 192.168.1.1: icmp_seq=0 ttl=64 time=7.266 ms64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=3.638 ms--- 192.168.1.1 ping statistics ---2 packets transmitted, 2 packets received, 0.0% packet lossround-trip min/avg/max/stddev = 3.638/5.452/7.266/1.814 msroot@opnFW1:~ # ping -c 2 172.16.1.1PING 172.16.1.1 (172.16.1.1): 56 data bytes--- 172.16.1.1 ping statistics ---2 packets transmitted, 0 packets received, 100.0% packet loss
root@opnFW1:/usr/local/etc # cat ipsec.conf# This file is automatically generated. Do not editconfig setup uniqueids = yesconn con1 aggressive = no fragmentation = yes keyexchange = ikev2 mobike = yes reauth = yes rekey = yes forceencaps = no installpolicy = no dpdaction = restart dpddelay = 10s dpdtimeout = 60s left = 192.168.1.10 right = 192.168.1.1 leftid = 192.168.1.10 ikelifetime = 28800s lifetime = 3600s ike = aes256gcm16-sha512-ecp512bp! leftauth = psk rightauth = psk rightid = 192.168.1.1 reqid = 1000 rightsubnet = 0.0.0.0/0 leftsubnet = 0.0.0.0/0 esp = aes256gcm16-sha512-ecp512bp! auto = start
root@opnFW2:/var/log # clog ipsec.log | grep 192.168.1.Mar 22 13:38:37 opnFW2 charon[41296]: 05[KNL] creating acquire job for policy 192.168.1.1/32 === 192.168.1.10/32 with reqid {9000}Mar 22 13:39:09 opnFW2 charon[41296]: 02[KNL] creating acquire job for policy 192.168.1.1/32 === 192.168.1.10/32 with reqid {9000}Mar 22 13:41:20 opnFW2 charon[41296]: 07[KNL] creating acquire job for policy 192.168.1.1/32 === 192.168.1.10/32 with reqid {9000}Mar 22 13:41:52 opnFW2 charon[41296]: 14[KNL] creating acquire job for policy 192.168.1.1/32 === 192.168.1.10/32 with reqid {9000}Mar 22 13:42:25 opnFW2 charon[41296]: 15[KNL] creating acquire job for policy 192.168.1.1/32 === 192.168.1.10/32 with reqid {9000}
root@opnFW2:/var/log # ping 192.168.1.10PING 192.168.1.10 (192.168.1.10): 56 data bytes64 bytes from 192.168.1.10: icmp_seq=0 ttl=64 time=7.893 ms64 bytes from 192.168.1.10: icmp_seq=1 ttl=64 time=7.310 ms64 bytes from 192.168.1.10: icmp_seq=2 ttl=64 time=7.990 ms^C--- 192.168.1.10 ping statistics ---3 packets transmitted, 3 packets received, 0.0% packet lossround-trip min/avg/max/stddev = 7.310/7.731/7.990/0.300 msroot@opnFW2:/var/log # ping -c 2 172.16.1.10PING 172.16.1.10 (172.16.1.10): 56 data bytes--- 172.16.1.10 ping statistics ---2 packets transmitted, 0 packets received, 100.0% packet lossroot@opnFW2:/var/log #
cat /usr/local/etc/ipsec.confconfig setup uniqueids = yesconn con9 aggressive = no fragmentation = yes keyexchange = ikev2 mobike = yes reauth = yes rekey = yes forceencaps = no installpolicy = no dpdaction = restart dpddelay = 10s dpdtimeout = 60s left = 192.168.1.1 right = 192.168.1.10 leftid = 192.168.1.1 ikelifetime = 28800s lifetime = 3600s ike = aes256gcm16-sha512-ecp512bp! leftauth = psk rightauth = psk rightid = 192.168.1.10 reqid = 9000 rightsubnet = 0.0.0.0/0 leftsubnet = 0.0.0.0/0 esp = aes256gcm16-sha512-ecp512bp! auto = start
Mar 24 19:30:10 FW3 charon[90790]: 14[IKE] <con1|1> giving up after 5 retransmitsMar 24 19:30:10 FW3 charon[90790]: 14[IKE] <con1|1> restarting CHILD_SA con1....Mar 24 19:32:55 FW3 charon[90790]: 12[IKE] <con1|2> giving up after 5 retransmitsMar 24 19:32:55 FW3 charon[90790]: 12[IKE] <con1|2> peer not responding, trying again (2/3)....Mar 24 19:35:40 FW3 charon[90790]: 08[IKE] <con1|2> giving up after 5 retransmitsMar 24 19:35:40 FW3 charon[90790]: 08[IKE] <con1|2> peer not responding, trying again (3/3).....Mar 24 19:38:25 FW3 charon[90790]: 05[IKE] <con1|2> giving up after 5 retransmitsMar 24 19:38:25 FW3 charon[90790]: 05[IKE] <con1|2> establishing IKE_SA failed, peer not responding
keyingtries = 3 | <number> | %foreverhow many attempts (a positive integer or %forever) should be made to negotiate a connection, or a replacementfor one, before giving up (default 3). The value %forever means 'never give up'. Relevant only locally, other end neednot agree on it.
Hi,One could have that impression. I am tunneling with Linux/openswan and pfSense since a long time. Now I am diging into opnsense IPsec, still frustrated.First learning, never use policy-based, chose route-based IPsec (1). I am using a lab infrastructure with several APU (pcengines) and some Supermicro/Celeron Firewalls as test machines. At the moment I take advantage of the cold weather to setup-test-discard-start over...At the end I will see if I can handle ipsec in a reliable way, switch to openvpn or do not use opnsense for site-to-site tunneling.Don't give up!Uwe(1) https://weberblog.net/route-vs-policy-based-vpn-tunnels/
And let me reply to myself again - the missing keyword here is "keyingtries"https://wiki.strongswan.org/projects/strongswan/wiki/connsectionQuotekeyingtries = 3 | <number> | %foreverhow many attempts (a positive integer or %forever) should be made to negotiate a connection, or a replacementfor one, before giving up (default 3). The value %forever means 'never give up'. Relevant only locally, other end neednot agree on it.And the issue raised back in 2020 - https://github.com/opnsense/core/issues/4204
Yep it was me complaining, but this only happens on unreliable WANs. For these areas I switched to OpenVPN based IPsec, but I'd also like to diagnose further if you still interested. When I see couple of replies in a thread I usually dont look at it since I guess already another guys is helping out Since you already fiddled with the .conf and CLI, can you grab your generated ipsec.conf, search for the affected con, add keyingtries=%forever and put this in a .conf file in the include folder. Then remove the ipsec from UI and restart IPsec. Is it then stable enough?I can always reopen the issue, but it needs more voices to make progress since changing things in such a sensible area is always risky.Thanks for hacking on
cat /usr/local/etc/ipsec.opnsense.d/never-give-up.confconn %default keyingtries = %forever
Please note there is a limitation in FreeBSD with pf that you can't use NAT with route-based IPsec. No matter if using OPNsense or pfSense.