If you are trying to connect to a corporate VPN and receive the following error: -

The L2TP connection attempt failed because the security layer encountered a processing error during initial negotiations with the remote computer
There is a high likelihood that you need to make a change in the registry and then restart your machine. To do this, follow these steps: -
- Click Start and type regedit and press OK
- Navigate to the following registry key - HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PolicyAgent
- Look in the right panel for the following RegValue - AssumeUDPEncapsulationContextOnSendRule (if it doesn't exist, create it as a type DWORD)
- Make sure the Data Value is set to 2
- Exit regedit
- Restart the machine
The above changes should allow a VPN connection to connect to the VPN correctly.
Here is the Microsoft Knwoledgebase article to support the above: -