core: IPsec with 22.1 does not work out of the box

Important notices

Before you add a new report, we ask you kindly to acknowledge the following:

Describe the bug

When configuring an IPsec connection within 22.1 the connection does not start up automatically.

To Reproduce

  1. Create an IPsec configuration (P1+P2)
  2. Enable IPsec
  3. Check logs
  • connection does not come up
  • Error: unable to add SAD entry with SPI c6651939: Invalid argument (22)
  1. Manually load ipsec kernel module (e.g. kldload ipsec or via tunables GUI).
  2. Connection starts up

Expected behavior

Connection should start in default configuration without additional configurations by the user.

Describe alternatives you considered

User can manually add the “ipsec_load yes” configuration to the tunables GUI - not really practicable

Screenshots

If applicable, add screenshots to help explain your problem.

Relevant log files

Following log lines are present during charon startup when the kernel module is not loaded:

2022-01-04T13:30:35	Informational	charon	00[NET] enabling UDP decapsulation for IPv4 on port 4500 failed	
2022-01-04T13:30:35	Informational	charon	00[KNL] unable to set UDP_ENCAP: Protocol not available	
2022-01-04T13:30:35	Informational	charon	00[NET] installing IKE bypass policy failed	
2022-01-04T13:30:35	Informational	charon	00[KNL] unable to set IPSEC_POLICY on socket: Protocol not available	
2022-01-04T13:30:35	Informational	charon	00[NET] installing IKE bypass policy failed	
2022-01-04T13:30:35	Informational	charon	00[KNL] unable to set IPSEC_POLICY on socket: Protocol not available	
2022-01-04T13:30:35	Informational	charon	00[NET] enabling UDP decapsulation for IPv6 on port 4500 failed	
2022-01-04T13:30:35	Informational	charon	00[KNL] unable to set UDP_ENCAP: Invalid argument	
2022-01-04T13:30:35	Informational	charon	00[NET] installing IKE bypass policy failed	
2022-01-04T13:30:35	Informational	charon	00[KNL] unable to set IPSEC_POLICY on socket: Protocol not available	
2022-01-04T13:30:35	Informational	charon	00[NET] installing IKE bypass policy failed	
2022-01-04T13:30:35	Informational	charon	00[KNL] unable to set IPSEC_POLICY on socket: Protocol not available	
2022-01-04T13:30:35	Informational	charon	00[DMN] Starting IKE charon daemon (strongSwan 5.9.4, FreeBSD 13.0-STABLE, amd64)

Additional context

https://forum.opnsense.org/index.php?topic=26231.0

Environment

Software version used and hardware type if relevant, e.g.:

OPNsense 22.1_b189 (amd64, OpenSSL).

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (17 by maintainers)

Commits related to this issue

Most upvoted comments

I guess we should just follow https://github.com/freebsd/freebsd-ports/commit/3b35676c7a812c7 as the commit implied when we start strongswan (ipsec configure)