Windows – Can’t connect to L2TP/IPsec VPN on windows but works fine on phone on same network

networkingvpnwindows 10

I have a remote VPN server running which I want to connect to. On my android phone it works fine on both mobile network and my home wifi network. However, on my windows machine I can't get it to work whatsoever. There is no useful error information other than the one below. In other words, it has something to do with the way Windows is trying to connect and I have no clue where to start debugging.

VPN connection error

My config looks like this

VPN config

I am using a pre-shared key which I have entered in the advanced settings. My firewall is off.

Best Answer

I had the same issue. I found that creating this DWORD registry value and rebooting the client resolved this issue:

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\PolicyAgent]
"AssumeUDPEncapsulationContextOnSendRule"=dword:00000002

The registry change is mentioned in this KB article : http://support.microsoft.com/kb/926179

In case the KB article goes away, the possible values are as following:

  • 0 (default): A value of 0 (zero) configures Windows XP SP2 so that it cannot initiate IPsec-secured communications with responders that are located behind network address translators.
  • 1: A value of 1 configures Windows XP SP2 so that it can initiate IPsec-secured communications with responders that are located behind network address translators.
  • 2: A value of 2 configures Windows XP SP2 so that it can initiate IPsec-secured communications when both the initiators and the responders are behind network address translators.
Related Question