Set up a VPN on Windows

Windows includes its own VPN client for Windows 11 and Windows 10. These steps show how to set up a VPN for Windows 11 or a VPN for Windows 10 in Settings, connect and disconnect, and fix the most common errors.

Last updated:

Short answer: to add a VPN in Windows 11, open Settings > Network & internet > VPN and select Add VPN. Choose Windows (built-in) as the provider and enter the server address, VPN type and sign-in info from your VPN provider or administrator. Then select Save and Connect. In Windows 10 the path is Settings > Network & Internet > VPN > Add a VPN connection. The built-in client supports IKEv2, SSTP, L2TP/IPsec and PPTP; WireGuard and OpenVPN need a separate app.

Before you begin

The built-in client connects to an existing VPN server; it does not come with servers of its own. Have these details ready from your organization, your VPN service or your own server:

  • Server name or address (for example, a host name or an IP address).
  • VPN type: IKEv2, SSTP, L2TP/IPsec or PPTP.
  • Sign-in method: user name and password, smart card, one-time password or certificate.
  • For L2TP/IPsec: a pre-shared key or a certificate.
  • For certificate-based IKEv2: the server's root certificate, imported into the computer's Trusted Root Certification Authorities store if your administrator requires it.

Tip: Many VPN services use WireGuard or OpenVPN, which are not part of the built-in Windows client. In that case, use the client app that your VPN service or administrator provides. See VPN protocols for details.

Add and connect a VPN

Windows 11: add a VPN connection

  1. Open Settings by pressing Win + I.
  2. Select Network & internet, then VPN.
  3. Next to VPN connections, select Add VPN.
  4. Under VPN provider, choose Windows (built-in).
  5. In Connection name, enter a name you will recognize, such as Work VPN.
  6. In Server name or address, enter the address you were given.
  7. Choose the VPN type (for example, IKEv2) and the Type of sign-in info.
  8. Optionally enter your user name and password, then select Save.

Windows 11: connect

  1. Go to Settings > Network & internet > VPN and select Connect next to your connection.
  2. Or press Win + A to open Quick Settings, select the VPN tile, choose the connection and select Connect.
  3. When it shows Connected, your traffic is going through the VPN.

On the same VPN page, Advanced settings for all VPN connections lets you allow or block VPN use over metered networks and while roaming.

Note: Windows 10 reached end of support on October 14, 2025. Devices outside the Extended Security Updates program no longer receive security updates, which weakens overall protection even with a VPN. Home users in the United States and Canada can enroll in consumer ESU for updates until October 12, 2027 (see the FAQ). Moving to Windows 11 is recommended.

Windows 10: add a VPN connection

  1. Select Start > Settings (or press Win + I).
  2. Select Network & Internet, then VPN.
  3. Select Add a VPN connection.
  4. Under VPN provider, choose Windows (built-in).
  5. Enter a Connection name and the Server name or address.
  6. Choose the VPN type and the Type of sign-in info.
  7. Optionally enter your user name and password, then select Save.

Windows 10: connect

  1. Select the network icon on the right side of the taskbar.
  2. Select your VPN connection, then select Connect.
  3. Enter your credentials if asked. The connection shows Connected when active.

Disconnect, edit or remove a connection

  • Disconnect: open Settings > Network & internet > VPN (or Quick Settings) and select Disconnect.
  • Edit: on the VPN page, expand the connection and choose Advanced options to change the server, sign-in info or proxy settings.
  • Remove: expand the connection and select Remove, then confirm.

Choosing the VPN type

If you can choose, prefer IKEv2 for speed and quick reconnection when you change networks, or SSTP when firewalls only allow web traffic. Use L2TP/IPsec only when nothing else is available, and avoid PPTP. The protocols page explains why.

Advanced: manage VPNs with PowerShell

Windows includes the VpnClient PowerShell module. Open Windows Terminal or PowerShell and replace the placeholder values with your own.

Create an IKEv2 connection:

Add-VpnConnection -Name "Work VPN" -ServerAddress "SERVER_ADDRESS" `
  -TunnelType Ikev2 -EncryptionLevel Required `
  -AuthenticationMethod Eap -RememberCredential

List connections and check their status:

Get-VpnConnection | Select-Object Name, ServerAddress, TunnelType, ConnectionStatus

Connect and disconnect from the command line:

rasdial "Work VPN" USERNAME PASSWORD
rasdial "Work VPN" /disconnect

Turn split tunneling on or off (split tunneling sends only traffic for the remote network through the VPN):

Set-VpnConnection -Name "Work VPN" -SplitTunneling $true
Set-VpnConnection -Name "Work VPN" -SplitTunneling $false

Remove a connection:

Remove-VpnConnection -Name "Work VPN" -Force

Security note: typing a password directly after rasdial can leave it in your command history. Prefer entering credentials in the Windows sign-in prompt.

Troubleshooting common errors

ErrorWhat it usually meansWhat to try
691The user name or password was not accepted.Re-enter your credentials carefully and check the sign-in type. Confirm your account is active.
789L2TP/IPsec security negotiation failed.Check the pre-shared key or certificate, and make sure the VPN type matches the server.
800The VPN server could not be reached.Check the server address and your internet connection; a firewall may be blocking the VPN.
809The server is not responding, often because a firewall or router blocks the ports used by IKEv2 or L2TP.Ask the network owner to allow UDP ports 500 and 4500, or use SSTP, which runs over TCP port 443.
812The server's policy rejected the connection, often because the authentication method does not match.Ask the server administrator which sign-in method and protocol to use.
868The server name could not be resolved.Check the spelling of the server address and confirm DNS works without the VPN.
13801IKEv2 certificate authentication failed.Make sure the correct root certificate is present and the server name matches its certificate.

VPN error 691 on Windows

Error 691 means the VPN server rejected your sign-in: the user name and password were not recognized, or the server does not allow the authentication method you chose. Re-type the credentials, checking Caps Lock and whether the server expects DOMAIN\user or an email address. Then confirm the Type of sign-in info matches what your administrator gave you, and check that your account is not locked or expired.

VPN error 789 on Windows

Error 789 means the L2TP/IPsec connection failed during the first security negotiation, before your user name and password were checked. The usual cause is a pre-shared key or certificate that does not match the server, or a VPN type that does not match. Re-enter the pre-shared key under the connection's Advanced options. Set the VPN type to L2TP/IPsec with pre-shared key (or with certificate) as the server requires. If possible, switch to IKEv2 or SSTP.

VPN error 800 on Windows

Error 800 means Windows could not establish a connection to the VPN server at all. Check that the server address is spelled correctly and that your internet connection works without the VPN. If the address is right, a firewall on your network or on the server may be blocking the VPN type you chose. Setting the VPN type to the exact protocol the server uses, instead of Automatic, often gives a clearer error.

VPN error 809 on Windows

Error 809 means the VPN server did not respond. This usually happens when a firewall or router between you and the server blocks the UDP ports used by IKEv2 and L2TP/IPsec (500 and 4500). Ask the network owner to allow those ports, or use SSTP, which runs over TCP port 443 like HTTPS. For L2TP/IPsec to a server behind a NAT router, Microsoft documents a registry change: set the DWORD AssumeUDPEncapsulationContextOnSendRule to 2 under HKLM\SYSTEM\CurrentControlSet\Services\PolicyAgent and restart the PC.

VPN error 812 on Windows

Error 812 means a policy on the VPN server blocked the connection. Most often, the authentication method or protocol on your PC is not one the server allows, or your account is not in a group permitted to connect. Ask the server administrator which VPN type, sign-in method and account group to use; the fix is on the server side or in matching its settings.

VPN error 868 on Windows

Error 868 means Windows could not resolve the VPN server's name to an IP address. Check the spelling of the server name, then confirm DNS works by opening a website without the VPN. If other sites load, the server name may be wrong or no longer exist; try the server's IP address if your provider gives one.

VPN error 13801 on Windows

Error 13801 means IKEv2 certificate authentication failed: Windows did not accept the server's certificate. Common causes are a missing root certificate in the Trusted Root Certification Authorities store, an expired certificate, or a server name that does not match the certificate. Import the root certificate your administrator provides, check the PC's date and time, and connect using the exact name on the certificate.

General fixes solve many problems. Restart the PC and make sure Windows is fully updated in Settings > Windows Update. Check that the date and time are correct, because certificate checks depend on them. Finally, try a different network to rule out a blocking router.

After connecting: follow the checks on the safety tips page to confirm your IP address and DNS are protected.