Настраиваю туннель IPsec (без L2TP). Сервер — strongswan на Debian'е, клиент — NetworkManager-strongswan на openSUSE.
Подключается быстро, работает хорошо, трафик ходит, но недолго: примерно через 5 минут соединение рвётся.
Проблема проявляется только на Linux'е, встроенные IKEv2-клиенты на OS X и Windows и даже официальный клиент strongswan для Android из той же сети работают нормально и не рвутся.
Лог (123.123.123.123 — адрес сервера, 234.234.234.234 и 192.168.33.100 — внешний и внутренний адреса клиента):
авг 13 20:04:42 carbide NetworkManager[1149]: <info> (tun0): Activation: successful, device activated.
авг 13 20:04:42 carbide systemd[1]: Started Network Manager Script Dispatcher Service.
авг 13 20:04:42 carbide audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=NetworkManager-dispatcher comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
авг 13 20:04:42 carbide nm-dispatcher[17040]: Dispatching action 'vpn-up' for tun0
авг 13 20:04:46 carbide charon-nm[15554]: 14[IKE] retransmit 1 of request with message ID 6
авг 13 20:04:46 carbide charon-nm[15554]: 14[NET] sending packet: from 192.168.33.100[4500] to 123.123.123.123[4500] (92 bytes)
авг 13 20:04:52 carbide audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=NetworkManager-dispatcher comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
авг 13 20:04:53 carbide charon-nm[15554]: 04[IKE] retransmit 2 of request with message ID 6
авг 13 20:04:53 carbide charon-nm[15554]: 04[NET] sending packet: from 192.168.33.100[4500] to 123.123.123.123[4500] (92 bytes)
авг 13 20:05:06 carbide charon-nm[15554]: 13[IKE] retransmit 3 of request with message ID 6
авг 13 20:05:06 carbide charon-nm[15554]: 13[NET] sending packet: from 192.168.33.100[4500] to 123.123.123.123[4500] (92 bytes)
авг 13 20:05:29 carbide charon-nm[15554]: 12[IKE] retransmit 4 of request with message ID 6
авг 13 20:05:29 carbide charon-nm[15554]: 12[NET] sending packet: from 192.168.33.100[4500] to 123.123.123.123[4500] (92 bytes)
авг 13 20:06:11 carbide charon-nm[15554]: 14[IKE] retransmit 5 of request with message ID 6
авг 13 20:06:11 carbide charon-nm[15554]: 14[NET] sending packet: from 192.168.33.100[4500] to 123.123.123.123[4500] (92 bytes)
авг 13 20:07:27 carbide charon-nm[15554]: 12[IKE] giving up after 5 retransmits
авг 13 20:07:27 carbide NetworkManager[1149]: <warn> VPN plugin failed: connect-failed (1)
авг 13 20:07:27 carbide audit: MAC_IPSEC_EVENT op=SAD-delete auid=4294967295 ses=4294967295 src=123.123.123.123 dst=192.168.33.100 spi=3439037053(0xccfb8a7d) res=1
авг 13 20:07:27 carbide NetworkManager[1149]: <info> VPN plugin state changed: stopped (6)
авг 13 20:07:27 carbide audit: MAC_IPSEC_EVENT op=SAD-delete auid=4294967295 ses=4294967295 src=192.168.33.100 dst=123.123.123.123 spi=3223190810(0xc01dfd1a) res=1
авг 13 20:07:27 carbide audit: MAC_IPSEC_EVENT op=SPD-add auid=4294967295 ses=4294967295 res=1 src=172.16.42.2 dst=0.0.0.0 dst_prefixlen=0
авг 13 20:07:27 carbide NetworkManager[1149]: <info> VPN plugin state change reason: unknown (0)
Aug 13 20:04:42 pbserv ipsec[140232]: 12[IKE] authentication of 'gasinvein' with EAP successful
Aug 13 20:04:42 pbserv charon: 09[NET] received packet: from 234.234.234.234[1040] to 123.123.123.123[4500] (92 bytes)
Aug 13 20:04:42 pbserv charon: 09[ENC] parsed INFORMATIONAL request 6 [ N(ADD_4_ADDR) N(ADD_4_ADDR) ]
Aug 13 20:04:42 pbserv charon: 09[ENC] generating INFORMATIONAL response 6 [ ]
Aug 13 20:04:42 pbserv charon: 09[NET] sending packet: from 123.123.123.123[4500] to 234.234.234.234[1040] (76 bytes)
Aug 13 20:04:46 pbserv charon: 03[NET] received packet: from 234.234.234.234[1040] to 123.123.123.123[4500] (92 bytes)
Aug 13 20:04:46 pbserv charon: 03[ENC] parsed INFORMATIONAL request 6 [ N(ADD_4_ADDR) N(ADD_4_ADDR) ]
Aug 13 20:04:46 pbserv charon: 03[IKE] received retransmit of request with ID 6, retransmitting response
Aug 13 20:04:46 pbserv charon: 03[NET] sending packet: from 123.123.123.123[4500] to 234.234.234.234[1040] (76 bytes)
Aug 13 20:04:53 pbserv charon: 03[NET] received packet: from 234.234.234.234[1040] to 123.123.123.123[4500] (92 bytes)
Aug 13 20:04:53 pbserv charon: 03[ENC] parsed INFORMATIONAL request 6 [ N(ADD_4_ADDR) N(ADD_4_ADDR) ]
Aug 13 20:04:53 pbserv charon: 03[IKE] received retransmit of request with ID 6, retransmitting response
Aug 13 20:04:53 pbserv charon: 03[NET] sending packet: from 123.123.123.123[4500] to 234.234.234.234[1040] (76 bytes)
Aug 13 20:05:06 pbserv charon: 07[NET] received packet: from 234.234.234.234[1040] to 123.123.123.123[4500] (92 bytes)
Aug 13 20:05:06 pbserv charon: 07[ENC] parsed INFORMATIONAL request 6 [ N(ADD_4_ADDR) N(ADD_4_ADDR) ]
Aug 13 20:05:06 pbserv charon: 07[IKE] received retransmit of request with ID 6, retransmitting response
Aug 13 20:05:06 pbserv charon: 07[NET] sending packet: from 123.123.123.123[4500] to 234.234.234.234[1040] (76 bytes)
Aug 13 20:05:10 pbserv charon: 13[IKE] retransmit 5 of request with message ID 0
Aug 13 20:05:10 pbserv charon: 13[NET] sending packet: from 123.123.123.123[4500] to 234.234.234.234[4500] (76 bytes)
Aug 13 20:05:29 pbserv charon: 14[NET] received packet: from 234.234.234.234[1040] to 123.123.123.123[4500] (92 bytes)
Aug 13 20:05:29 pbserv charon: 14[ENC] parsed INFORMATIONAL request 6 [ N(ADD_4_ADDR) N(ADD_4_ADDR) ]
Aug 13 20:05:29 pbserv charon: 14[IKE] received retransmit of request with ID 6, retransmitting response
Aug 13 20:05:29 pbserv charon: 14[NET] sending packet: from 123.123.123.123[4500] to 234.234.234.234[1040] (76 bytes)
Aug 13 20:06:11 pbserv charon: 09[NET] received packet: from 234.234.234.234[1040] to 123.123.123.123[4500] (92 bytes)
Aug 13 20:06:11 pbserv charon: 09[ENC] parsed INFORMATIONAL request 6 [ N(ADD_4_ADDR) N(ADD_4_ADDR) ]
Aug 13 20:06:11 pbserv charon: 09[IKE] received retransmit of request with ID 6, retransmitting response
Aug 13 20:06:11 pbserv charon: 09[NET] sending packet: from 123.123.123.123[4500] to 234.234.234.234[1040] (76 bytes)
Aug 13 20:06:26 pbserv charon: 11[IKE] giving up after 5 retransmits
Aug 13 20:06:26 pbserv charon: 11[CFG] sending RADIUS Accounting-Request to server 'server-a'
Aug 13 20:06:26 pbserv charon: 11[CFG] received RADIUS Accounting-Response from server 'server-a'
Aug 13 20:06:26 pbserv charon: 11[CFG] lease 172.16.42.1 by 'gasinvein' went offline