This new year started with issue from user that could not connected to L2TP VPN that i've setup before. This issue happend since i move VPN router under Firewall and do NAT 1:1 on it. my user reported that it shows an error below
After searching it at microsoft forum, i found that caused by default since windows Vista and Windows Server 2008 that don't support IPSEC NAT-T security associations to servers that are behind a NAT device. If the virtual private network (VPN) server is behind a NAT device, a Windows Vista or Windows Server 2008-based VPN client computer can't make a Layer 2 Tunneling Protocol (L2TP)/IPsec connection to the VPN server. This scenario includes VPN servers that are running Windows Server 2008 and Windows Server 2003.
Because of the way in which NAT devices translate network traffic, you may experience unexpected results in the following scenario:
- You put a server behind a NAT device.
- You use an IPsec NAT-T environment.
If you must use IPsec for communication, use public IP addresses for all servers that you can connect to from the Internet. If you must put a server behind a NAT device, and then use an IPsec NAT-T environment, you can enable communication by changing a registry value on the VPN client computer and the VPN server.
Based on microsoft learn, the solution for this issue was simple. Just add a registry value named AssumeUDPEncapsulationContextOnSendRule.
follow these steps:
Log on to the Windows Vista client computer as a user who is a member of the Administrators group.
Select Start > All Programs > Accessories > Run, type regedit, and then select OK. If the User Account Control dialog box is displayed on the screen and prompts you to elevate your administrator token, select Continue.
Locate and then select the following registry subkey:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PolicyAgent
On the Edit menu, point to New, and then select DWORD (32-bit) Value.
Type AssumeUDPEncapsulationContextOnSendRule, and then press ENTER.
Right-click AssumeUDPEncapsulationContextOnSendRule, and then select Modify.
In the Value Data box, type one of the following values:
0
It's the default value. When it's set to 0, Windows can't establish security associations with servers located behind NAT devices.
1
When it's set to 1, Windows can establish security associations with servers that are located behind NAT devices.
2
When it's set to 2, Windows can establish security associations when both the server and VPN client computer (Windows Vista or Windows Server 2008-based) are behind NAT devices.
Select OK, and then exit Registry Editor.
Restart the computer.