Strongswan only works for 90 minutes

My VPN works great for about 90 minutes, then it goes down, and I get this in 'logread':

Mon Feb 10 12:24:52 2020 authpriv.info ipsec: 06[CFG] received proposals: ESP:AES_CBC_256/HMAC_SHA2_256_128/MODP_1024/NO_EXT_SEQ
Mon Feb 10 12:24:52 2020 authpriv.info ipsec: 06[CFG] configured proposals: ESP:AES_CBC_128/AES_CBC_192/AES_CBC_256/HMAC_SHA2_256_128/HMAC_SHA2_384_192/HMAC_SHA2_512_256/HMAC_SHA1_96/AES_XCBC_96/NO_EXT_SEQ
Mon Feb 10 12:24:52 2020 authpriv.info ipsec: 06[IKE] no acceptable proposal found

and

Mon Feb 10 12:24:54 2020 authpriv.info ipsec: 12[JOB] CHILD_SA ESP/0xc5c130a2/75.0.0.20 not found for rekey

When it tries to reconnect.
Here is my /etc/config/ipsec:

config 'ipsec'
option 'debug' '1'
option 'zone' 'wan'

config 'remote' 'REMOTE'
option 'enabled' '1'
option 'gateway' '200.0.0.20'
option 'pre_shared_key' 'XXxxXXxxXXxxXX'
option 'authentication_method' 'psk'
list 'tunnel' 'remote_lan'
list 'p1_proposal' 'remote_p1'
option 'local_identifier' '192.168.2.4'

config 'tunnel' 'remote_lan'
option 'local_subnet' '192.168.2.0/24'
option 'remote_subnet' '192.168.168.0/24'
option 'mode' 'route'
option 'dpdaction' 'clear'
option 'p2_proposal' 'remote_p2'

config 'p1_proposal' 'remote_p1'
option encryption_algorithm' 'aes256'
option 'hash_algorithm' 'sha256'
option 'dh_group' '14'

config 'p2_proposal' 'remote_p2'
option 'encryption_algorithm' 'aes256'
option 'authentication_algorithm' 'sha256'

During ESP setup/rekeying, the remote peer asks for a DH exchange with group 2 (MODP_1024) , which is not accepted by the local strongSwan on OpenWrt.

As a quick fix, you could add the DH group for PFS (untested):

config 'p2_proposal' 'remote_p2'
	...
	option 'pfs_group' '2'

However, I would recommend to use a stronger DH group (at least modp2048), or perhaps elliptic curve DH if supported by the remote gateway. This needs to be changed on both peers, of course.

Regarding the 90 minutes, this might be the rekeying interval. The first child SA was created along with the IKE SA, using the keying material created with "phase 1" settings. Any problems with the "phase 2" DH settings did not surface until the first rekeying.