How to resolve L2TP/IPsec tunnel error in VPN connection on Windows 10/Windows 11?

Ernesto Porro Gomez 5 Reputation points
2023-12-01T08:58:51.7766667+00:00

I have set up an L2TP/IPsec VPN connection, and when trying to establish it from my company's computer, I encounter the following error:

"The remote connection could not be established because an error occurred in the tested VPN tunnels. The VPN server may be inaccessible. If the connection is attempting to use an L2TP/IPsec tunnel, the necessary security parameters for IPsec negotiation may not be configured correctly."

The VPN configuration seems correct, as I have tested it on several personal devices (Windows11), and it works fine.

However, the error consistently appears on the computers within my company. I have tried it on different models we have (HP, Lenovo), running both Windows 11 and Windows 10.

I have conducted the following checks without success:

Verified the Windows patches KB5009566 for Windows 11 and KB5009543 for Windows 10. They are not installed.

Enabled the "Microsoft CHAP version 2 (MS-CHAP v2)" protocol in the VPN connection.

Activated the "Enable LCP extension" option within the "PPP Configuration" in the VPN settings.

Restarted and set the "IPsec Policy Agent and IKE" and "AuthIP IPsec Keying Modules" services to start automatically.

Can anyone help me find a solution to this issue?vpn_error

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
12,077 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
11,143 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Gary Nebbett 6,196 Reputation points
    2023-12-01T10:04:27.45+00:00

    Hello Ernesto,

    The error message is probably providing useful hints ("the necessary security parameters for IPsec negotiation may not be configured correctly").

    The security parameters can be configured with the PowerShell cmdlet Set-VpnConnectionIPsecConfiguration.

    Here is an example usage from my PC:

    Set-VpnConnectionIPsecConfiguration -Name "Test FQDN" -EncryptionMethod AES256 -IntegrityCheckMethod SHA256 -DHGroup Group14 -AuthenticationTransformConstants SHA256 -CipherTransformConstants AES256 -PfsGroup None -Force

    Gary


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.