Setting up Windows built-in VPN client
This guide explains how to configure the Windows built-in L2TP/IPsec VPN client to connect to your VPN gateway.
Creating the VPN connection
- Open VPN settings by pressing Win + R, typing
ms-settings:network-vpn, and pressing Enter.
- Click Add a VPN connection and fill in the fields:
- VPN provider: Windows (built-in)
- Connection name: GPN
- VPN type: L2TP/IPsec with pre-shared key
- Server name or address: your VPN server address (from user credentials)
- Pre-shared key: your Shared Secret (from user credentials)
- User name: your Login (from user credentials)
- Password: your Password (from user credentials)
Click Save.

Configuring additional parameters via PowerShell
- Open PowerShell: click Start, type PowerShell, and click Windows PowerShell.
- Run the following command to check the connection properties:
Get-VpnConnection -Name "GPN" -erroraction 'silentlycontinue'; Get-VpnConnection -AllUserConnection -Name "GPN" -erroraction 'silentlycontinue'
5. Check the AllUserConnection property in the output. If it reads True, the VPN is in the global (machine) phone book — run:
Set-VpnConnection -Name "GPN" -EncryptionLevel "Optional" -AuthenticationMethod CHAP, MSCHAPv2 -SplitTunneling $True -AllUserConnection -PassThruIf AllUserConnection reads False, run:
Set-VpnConnection -Name "GPN" -EncryptionLevel "Optional" -AuthenticationMethod CHAP, MSCHAPv2 -SplitTunneling $True -PassThru
- Add the route for the VPN connection:
Add-VpnConnectionRoute -ConnectionName "GPN" -DestinationPrefix "10.0.0.0/8"Connecting to the VPN
You can connect in any of the following ways:
- Settings: Press Win + R, type
ms-settings:network-vpn, press Enter, select GPN, and click Connect. - System tray: Click the network icon, choose GPN, and click Connect.
- PowerShell: Run
rasdial GPN.
Troubleshooting
If you see the error:
The L2TP connection attempt failed because the security layer encountered a processing error during initial negotiations with the remote computerOpen Command Prompt as Administrator and run:
Set-VpnConnectionIPsecConfiguration -ConnectionName "GPN" -AuthenticationTransformConstants SHA196 -CipherTransformConstants AES256 -EncryptionMethod AES256 -IntegrityCheckMethod SHA256 -PfsGroup None -DHGroup Group14 -PassThru -ForceNote: Replace
"GPN"with your actual VPN connection name if you used a different one.