<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto">This is a different issue I have not seen before. It seems there is confusion about state between kernel and pluto ?<div><br></div><div>To say more, i would need to see the logs from a valid state going to this bad state.</div><div><br></div><div>Paul<br><br><div dir="ltr">Sent from my iPhone</div><div dir="ltr"><br><blockquote type="cite">On Jan 22, 2021, at 07:03, António Silva <asilva@wirelessmundi.com> wrote:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr"><meta http-equiv="Content-Type" content="text/html; charset=utf-8">Hi,<div class=""><br class=""><div class="">I’m having the same issue, after upgrading the server side to version 4.1, every hour the tunnel disconnects, restarting the client side only makes it work again.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Here is the logs from the server side when the tunnel is reconnecting after an 1h:</div><div class=""><br class=""></div><div class=""><div class="">Jan 22 12:37:36 sol pluto[24350]: "tunnel8"[10] 95.61.168.133 #93: initiating IKEv1 Main Mode connection to replace #89</div><div class="">Jan 22 12:37:36 sol pluto[24350]: "tunnel8"[10] 95.61.168.133 #93: sent Main Mode request, replacing #89</div><div class="">Jan 22 12:37:36 sol pluto[24350]: "tunnel8"[10] 95.61.168.133 #94: responding to Main Mode from unknown peer 95.61.168.133:500</div><div class="">Jan 22 12:37:36 sol pluto[24350]: "tunnel8"[10] 95.61.168.133 #94: sent Main Mode R1</div><div class="">Jan 22 12:37:36 sol pluto[24350]: "tunnel8"[10] 95.61.168.133 #94: sent Main Mode R2</div><div class="">Jan 22 12:37:36 sol pluto[24350]: "tunnel8"[10] 95.61.168.133: queuing pending IPsec SA negotiating with 95.61.168.133 IKE SA #93 "tunnel8"[10] 95.61.168.133</div><div class="">Jan 22 12:37:36 sol pluto[24350]: "tunnel8"[10] 95.61.168.133 #94: Peer ID is ID_IPV4_ADDR: '192.168.1.2'</div><div class="">Jan 22 12:37:36 sol pluto[24350]: "tunnel8"[10] 95.61.168.133 #94: IKE SA established {auth=PRESHARED_KEY cipher=AES_CBC_256 integ=HMAC_SHA2_256 group=MODP2048}</div><div class="">Jan 22 12:37:36 sol pluto[24350]: "tunnel8"[10] 95.61.168.133 #94: XAUTH: Sending Username/Password request (MAIN_R3->XAUTH_R0)</div><div class="">Jan 22 12:37:36 sol pluto[24350]: "tunnel8"[10] 95.61.168.133 #94: XAUTH: password file authentication method requested to authenticate user '<a href="mailto:asilvapt@remote.local" class="">asilvapt@remote.local</a>'</div><div class="">Jan 22 12:37:36 sol pluto[24350]: "tunnel8"[10] 95.61.168.133 #94: XAUTH: password file (/etc/ipsec.d/passwd) open.</div><div class="">Jan 22 12:37:36 sol pluto[24350]: "tunnel8"[10] 95.61.168.133 #94: XAUTH: success user(<a href="mailto:asilvapt@remote.local" class="">asilvapt@remote.local</a>:(null))</div><div class="">Jan 22 12:37:36 sol pluto[24350]: "tunnel8"[10] 95.61.168.133 #94: XAUTH: User <a href="mailto:asilvapt@remote.local" class="">asilvapt@remote.local</a>: Authentication Successful</div><div class="">Jan 22 12:37:36 sol pluto[24350]: "tunnel8"[10] 95.61.168.133 #94: XAUTH: xauth_inR1(STF_OK)</div><div class="">Jan 22 12:37:36 sol pluto[24350]: "tunnel8"[10] 95.61.168.133 #94: IKE SA established {auth=PRESHARED_KEY cipher=AES_CBC_256 integ=HMAC_SHA2_256 group=MODP2048}</div><div class="">Jan 22 12:37:36 sol pluto[24350]: | pool 192.168.20.2-192.168.20.2: growing address pool from 0 to 1</div><div class="">Jan 22 12:37:36 sol pluto[24350]: "tunnel8"[10] 95.61.168.133 #94: modecfg_inR0(STF_OK)</div><div class="">Jan 22 12:37:36 sol pluto[24350]: "tunnel8"[10] 95.61.168.133 #94: sent ModeCfg reply, expecting Ack {auth=PRESHARED_KEY cipher=AES_CBC_256 integ=HMAC_SHA2_256 group=MODP2048}</div><div class="">Jan 22 12:37:36 sol pluto[24350]: "tunnel8"[10] 95.61.168.133 #93: STATE_MAIN_I1: retransmission; will wait 0.5 seconds for response</div><div class="">Jan 22 12:37:37 sol pluto[24350]: "tunnel8"[10] 95.61.168.133 #93: sent Main Mode I2</div><div class="">Jan 22 12:37:37 sol pluto[24350]: "tunnel8"[10] 95.61.168.133 #93: sent Main Mode I3</div><div class="">Jan 22 12:37:37 sol pluto[24350]: "tunnel8"[10] 95.61.168.133 #93: Peer ID is ID_IPV4_ADDR: '192.168.1.2'</div><div class="">Jan 22 12:37:37 sol pluto[24350]: "tunnel8"[10] 95.61.168.133 #93: IKE SA established {auth=PRESHARED_KEY cipher=AES_CBC_256 integ=HMAC_SHA2_256 group=MODP2048}</div><div class="">Jan 22 12:37:37 sol pluto[24350]: "tunnel8"[10] 95.61.168.133 #93: XAUTH: Sending Username/Password request (MAIN_I4->XAUTH_R0)</div><div class="">Jan 22 12:37:37 sol pluto[24350]: "tunnel8"[10] 95.61.168.133 #93: ignoring informational payload CERTIFICATE_UNAVAILABLE, msgid=00000000, length=12</div><div class="">Jan 22 12:37:37 sol pluto[24350]: "tunnel8"[10] 95.61.168.133 #93: received and ignored notification payload: CERTIFICATE_UNAVAILABLE</div><div class="">Jan 22 12:42:06 sol pluto[24350]: "tunnel8"[10] 95.61.168.133 #89: deleting state (STATE_MODE_CFG_R1) aged 3600.266987s and sending notification</div><div class="">Jan 22 12:42:06 sol pluto[24350]: "tunnel8"[10] 95.61.168.133 #90: deleting state (STATE_QUICK_R2) aged 3600.089852s and sending notification</div><div class="">Jan 22 12:42:06 sol pluto[24350]: "tunnel8"[10] 95.61.168.133 #90: ESP traffic information: in=11MB out=30MB <a href="mailto:XAUTHuser=asilvapt@remote.local" class="">XAUTHuser=asilvapt@remote.local</a></div><div class="">Jan 22 12:42:06 sol pluto[24350]: "tunnel8"[10] 95.61.168.133 #90: Warning: XAUTH username changed from '' to 'asilvaptremote.local'</div><div class="">Jan 22 12:42:06 sol pluto[24350]: "tunnel8"[10] 95.61.168.133 #93: ignoring Delete SA payload: PROTO_IPSEC_ESP SA(0x3e9fbbf6) not found (maybe expired)</div><div class="">Jan 22 12:42:06 sol pluto[24350]: ignoring found existing connection instance "tunnel8"[10] 95.61.168.133 that covers kernel acquire with IKE state #93 and IPsec state #0 - due to duplicate acquire?</div><div class="">Jan 22 12:42:36 sol pluto[24350]: existing bare shunt found - refusing to add a duplicate</div><div class="">Jan 22 12:42:36 sol pluto[24350]: ignoring found existing connection instance "tunnel8"[10] 95.61.168.133 that covers kernel acquire with IKE state #93 and IPsec state #0 - due to duplicate acquire?</div><div class="">Jan 22 12:42:36 sol pluto[24350]: existing bare shunt found - refusing to add a duplicate</div><div class="">Jan 22 12:42:36 sol pluto[24350]: ignoring found existing connection instance "tunnel8"[10] 95.61.168.133 that covers kernel acquire with IKE state #93 and IPsec state #0 - due to duplicate acquire?</div><div class="">Jan 22 12:43:06 sol pluto[24350]: existing bare shunt found - refusing to add a duplicate</div><div class="">Jan 22 12:43:06 sol pluto[24350]: ignoring found existing connection instance "tunnel8"[10] 95.61.168.133 that covers kernel acquire with IKE state #93 and IPsec state #0 - due to duplicate acquire?</div><div class="">Jan 22 12:43:36 sol pluto[24350]: existing bare shunt found - refusing to add a duplicate</div><div class="">Jan 22 12:43:36 sol pluto[24350]: ignoring found existing connection instance "tunnel8"[10] 95.61.168.133 that covers kernel acquire with IKE state #93 and IPsec state #0 - due to duplicate acquire?</div><div class="">Jan 22 12:44:06 sol pluto[24350]: existing bare shunt found - refusing to add a duplicate</div><div class="">Jan 22 12:44:06 sol pluto[24350]: ignoring found existing connection instance "tunnel8"[10] 95.61.168.133 that covers kernel acquire with IKE state #93 and IPsec state #0 - due to duplicate acquire?</div><div class="">Jan 22 12:44:37 sol pluto[24350]: existing bare shunt found - refusing to add a duplicate</div><div class="">Jan 22 12:44:37 sol pluto[24350]: ignoring found existing connection instance "tunnel8"[10] 95.61.168.133 that covers kernel acquire with IKE state #93 and IPsec state #0 - due to duplicate acquire?</div><div class="">Jan 22 12:45:07 sol pluto[24350]: existing bare shunt found - refusing to add a duplicate</div><div class="">Jan 22 12:45:07 sol pluto[24350]: ignoring found existing connection instance "tunnel8"[10] 95.61.168.133 that covers kernel acquire with IKE state #93 and IPsec state #0 - due to duplicate acquire?</div><div class="">Jan 22 12:45:12 sol pluto[24350]: "tunnel8"[10] 95.61.168.133 #93: received Delete SA payload: self-deleting ISAKMP State #93</div><div class=""><br class=""></div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">My configuration:</div><div class=""><div class="">conn tunnel8-aggr</div><div class=""><span class="Apple-tab-span" style="white-space:pre">     </span>aggrmode=yes</div><div class=""><span class="Apple-tab-span" style="white-space:pre">      </span>also=tunnel8</div><div class=""><br class=""></div><div class="">conn tunnel8</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>pfs=no</div><div class=""><span class="Apple-tab-span" style="white-space:pre">    </span>type=tunnel</div><div class=""><span class="Apple-tab-span" style="white-space:pre">       </span>auto=add</div><div class=""><span class="Apple-tab-span" style="white-space:pre">  </span>ikev2=no</div><div class=""><span class="Apple-tab-span" style="white-space:pre">  </span>phase2=esp</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>authby=secret</div><div class=""><span class="Apple-tab-span" style="white-space:pre">     </span>keyingtries=3</div><div class=""><span class="Apple-tab-span" style="white-space:pre">     </span>ikelifetime=24h</div><div class=""><span class="Apple-tab-span" style="white-space:pre">   </span>salifetime=1h</div><div class=""><span class="Apple-tab-span" style="white-space:pre">     </span>left=92.211.123.17</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>leftsubnet=0.0.0.0/0</div><div class=""><span class="Apple-tab-span" style="white-space:pre">      </span><a href="mailto:leftid=@xauth.remote.local" class="">leftid=@xauth.remote.local</a></div><div class=""><span class="Apple-tab-span" style="white-space:pre">       </span>right=%any</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>rightid=%any</div><div class=""><span class="Apple-tab-span" style="white-space:pre">      </span>rightaddresspool=192.168.20.100-192.168.20.254</div><div class=""><span class="Apple-tab-span" style="white-space:pre">    </span>dpddelay=30</div><div class=""><span class="Apple-tab-span" style="white-space:pre">       </span>dpdtimeout=300</div><div class=""><span class="Apple-tab-span" style="white-space:pre">    </span>dpdaction=clear</div><div class=""><span class="Apple-tab-span" style="white-space:pre">   </span>leftxauthserver=yes</div><div class=""><span class="Apple-tab-span" style="white-space:pre">       </span>rightxauthclient=yes</div><div class=""><span class="Apple-tab-span" style="white-space:pre">      </span>leftmodecfgserver=yes</div><div class=""><span class="Apple-tab-span" style="white-space:pre">     </span>rightmodecfgclient=yes</div><div class=""><span class="Apple-tab-span" style="white-space:pre">    </span>modecfgpull=yes</div><div class=""><span class="Apple-tab-span" style="white-space:pre">   </span>fragmentation=yes</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>xauthby=file</div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""><div class="">
<div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">--<br class="Apple-interchange-newline">Saludos / Regards / Cumprimentos</div><div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">António Silva</div><br class="Apple-interchange-newline"></div><br class="Apple-interchange-newline"><br class="Apple-interchange-newline">
</div>
<div><br class=""><blockquote type="cite" class=""><div class="">On 21 Jan 2021, at 20:01, Michael Schwartzkopff <<a href="mailto:ms@sys4.de" class="">ms@sys4.de</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">
  
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" class="">
  
  <div class="">
    <div class="moz-cite-prefix">On 21.01.21 20:53, Kontakt wrote:<br class="">
    </div>
    <blockquote type="cite" cite="mid:CAJYN4d5SyKZe+H1-hBpcF=yA+9aReGCr70MjHJvNbx8zMT4WaA@mail.gmail.com" class="">
      <pre class="moz-quote-pre" wrap="">Hello,
I have a problem. ipsec tunnel compiled on libreswan 4.1 (centos 8) for 1
client causes it to disconnect after 3600s. the same configuration on
libreswan 3.23 (centos 7) does not cause such problems. conf file,
password, iptables, entries in routing table identical.
I checked sysctl - identical. the only difference is selinux (centos 7 has
enforce, centos 8 disabled).

libreswan 3.23 (centos 7):

*ipsec verify*Verifying installed system and configuration files

Version check and ipsec on-path [OK]
Libreswan 3.23 (netkey) on 3.10.0-862.3.2.el7.x86_64
Checking for IPsec support in kernel [OK]
 NETKEY: Testing XFRM related proc values
         ICMP default / send_redirects [NOT DISABLED]

  Disable / proc / sys / net / ipv4 / conf / * / send_redirects or NETKEY
will act on or cause sending of bogus ICMP redirects!

         ICMP default / accept_redirects [OK]
         XFRM larval drop [OK]
Pluto ipsec.conf syntax [OK]
Two or more interfaces found, checking IP forwarding [OK]
Checking rp_filter [ENABLED]
 / proc / sys / net / ipv4 / conf / all / rp_filter [ENABLED]
 / proc / sys / net / ipv4 / conf / default / rp_filter [ENABLED]
 / proc / sys / net / ipv4 / conf / em1 / rp_filter [ENABLED]
 / proc / sys / net / ipv4 / conf / em2 / rp_filter [ENABLED]
 / proc / sys / net / ipv4 / conf / ip_vti0 / rp_filter [ENABLED]
  rp_filter is not fully aware of IPsec and should be disabled
Checking that pluto is running [OK]
 Pluto listening for IKE on udp 500 [OK]
 Pluto listening for IKE / NAT-T on udp 4500 [OK]
 Pluto ipsec.secret syntax [OK]
Checking 'ip' command [OK]
Checking 'iptables' command [OK]
Checking 'prelink' command does not interfere with FIPS [OK]
Checking for obsolete ipsec.conf options [OK]

ipsec verify: encountered 12 errors - see 'man ipsec_verify' for help

*And for libreswan 4.1 (centos 8):*
* ipsec verify*

Verifying installed system and configuration files

Version check and ipsec on-path [OK]
Libreswan 4.1 (netkey) on 4.18.0-193.28.1.el8_2.x86_64
Checking for IPsec support in kernel [OK]
 NETKEY: Testing XFRM related proc values
         ICMP default / send_redirects [OK]
         ICMP default / accept_redirects [OK]
         XFRM larval drop [OK]
Pluto ipsec.conf syntax [OK]
Checking rp_filter [OK]
Checking that pluto is running [OK]
 Pluto listening for IKE on udp 500 [OK]
 Pluto listening for IKE / NAT-T on udp 4500 [OK]
 Pluto ipsec.secret syntax [OK]
Checking 'ip' command [OK]
Checking 'iptables' command [OK]
Checking 'prelink' command does not interfere with FIPS [OK]
Checking for obsolete ipsec.conf options [OK]

Where to look for the problem?

</pre>
      <br class="">
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Swan mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Swan@lists.libreswan.org">Swan@lists.libreswan.org</a>
<a class="moz-txt-link-freetext" href="https://lists.libreswan.org/mailman/listinfo/swan">https://lists.libreswan.org/mailman/listinfo/swan</a>
</pre>
    </blockquote><p class=""><br class="">
    </p><p class=""><br class="">
    </p><p class="">Logs? of both sides?</p><p class="">Seems the child negotiation somehow fails. But the reason should
      be in the logs.<br class="">
    </p><p class=""><br class="">
    </p>
    <pre class="moz-signature" cols="72">Mit freundlichen Grüßen,

-- 

[*] sys4 AG
 
<a class="moz-txt-link-freetext" href="https://sys4.de/">https://sys4.de</a>, +49 (89) 30 90 46 64
Schleißheimer Straße 26/MG,80333 München
 
Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263
Vorstand: Patrick Ben Koetter, Marc Schiffbauer, Wolfgang Stief
Aufsichtsratsvorsitzender: Florian Kirstein</pre>
  </div>

_______________________________________________<br class="">Swan mailing list<br class=""><a href="mailto:Swan@lists.libreswan.org" class="">Swan@lists.libreswan.org</a><br class="">https://lists.libreswan.org/mailman/listinfo/swan<br class=""></div></blockquote></div><br class=""></div></div><span>_______________________________________________</span><br><span>Swan mailing list</span><br><span>Swan@lists.libreswan.org</span><br><span>https://lists.libreswan.org/mailman/listinfo/swan</span><br></div></blockquote></div></body></html>