OPNsense Forum

English Forums => Virtual private networks => Topic started by: glasi on October 02, 2022, 04:49:00 PM

Title: Only one tunnel in IPsec s2s VPN possible since update to OPNsense 22.7
Post by: glasi on October 02, 2022, 04:49:00 PM
I am running an IPsec site 2 site VPN with several phase 2 tunnels. Tunnel isolation has been enabled in phase 1 settings. All tunnels show up in ipsec.conf file.

This setup has been working flawlessly in OPNsense 22.1.

Unfortunately, since update to OPNsense 22.7 only one tunnel is possible. Once one tunnel (it doesn't matter which one) is being established no further connections can be established.

Any ideas how to fix?
Title: Re: Only one tunnel in IPsec s2s VPN possible since update to OPNsense 22.7
Post by: schnipp on October 03, 2022, 11:16:40 AM
I had similar issues after updating my Opnsense to the version 22.7.x short time ago. Before doing this I switched from LibreSSL to OpensSSL due to the fact that LibreSSL is deprecated (link (https://forum.opnsense.org/index.php?topic=29507.0)). Update went fine after a few approaches. But I didn't notice the issues with multiple isolated Child_SAs per IPsec connection. I started some research beginning with with the log error message "unable to install inbound and outbound IPsec SA (SAD) in kernel". Maybe at the other endpoint there will only be a message "no proposal chosen" depending on which endpoint started the negotiation.

Result is, that this is an issue with OpenSSL. Switching back to LibreSSL solved this issue. But, due to the discontinuation of LibreSSL this can only be a short term solution. The detailed problem is, that the key derive function in OpenSSL 1.1.x has not enough buffer space to handle modp8192. The key derive function fails with an error code and the IKE daemon is unable to negotiate additional phases 2.

I see the following resolutions:

References:
Title: Re: Only one tunnel in IPsec s2s VPN possible since update to OPNsense 22.7
Post by: glasi on October 03, 2022, 07:37:23 PM
Nice observation! Thanks for the references.

You are right. VPN logs showing "no proposal chosen" error when using modp8192. Switching to LibreSSL on both endpoints fixed the issue.

I hope OpenSSL will be fixed or upgraded to > 3.0.5 before LibreSSL will be dropped.
Title: Re: Only one tunnel in IPsec s2s VPN possible since update to OPNsense 22.7
Post by: schnipp on October 05, 2022, 06:46:54 PM
Github ticket see here (#6068) (https://github.com/opnsense/core/issues/6068).
Title: Re: Only one tunnel in IPsec s2s VPN possible since update to OPNsense 22.7
Post by: franco on October 06, 2022, 10:28:41 AM
https://github.com/opnsense/core/issues/6068#issuecomment-1269576040
Title: Re: Only one tunnel in IPsec s2s VPN possible since update to OPNsense 22.7
Post by: schnipp on October 06, 2022, 09:04:10 PM
A further workaround solution could be switching to DH group 31 when using OpenSSL flavor. Prerequisite is that the other endpoint must support this group.

I'll test this with my configuration next week.
Title: [Solved] Only one tunnel in IPsec s2s VPN possible since update to OPNsense 22.7
Post by: schnipp on October 24, 2022, 03:36:27 PM
I did some more tests. And as already mentioned using ECDH with group 31 as key exchange mechanism can be treated as a partial workaround compared to DH with modp8192 in combination with OpenSSL 1.x flavor. So far it looks good.