Set up a VPN on Windows, step by step
Use the VPN client built into Windows 11 and Windows 10. Pick your version below, follow the numbered steps, then verify that the tunnel is working.
Before you begin
Gather these details first. They come from whoever runs the VPN server — your organisation's IT team, your own router or server, or your VPN service.
- Server name or address — for example
203.0.113.10(an example address used throughout this guide). - VPN type — IKEv2, SSTP or L2TP/IPsec. See which to choose.
- Sign-in details — user name and password, a certificate, a smart card or a one-time password.
- Pre-shared key — only for L2TP/IPsec with a pre-shared key.
- A working internet connection and an up-to-date Windows (check Settings › Windows Update).
Choose your Windows version
Not sure which one you have? Press Windows key + R, type winver and press Enter.
Windows 11
Open the VPN settings
Press Windows key + I to open Settings, then go to:
Network & internet›VPNSelect “Add VPN”
Next to VPN connections, select Add VPN. A dialog opens.
Fill in the connection details
- VPN provider: Windows (built-in)
- Connection name: any label, e.g. “Office VPN”
- Server name or address: from your VPN details
- VPN type: the type your server uses, e.g. IKEv2
- Type of sign-in info: usually “User name and password”
For L2TP/IPsec with a pre-shared key, a Pre-shared key field appears — enter it exactly.
Save
Optionally enter your user name and password and tick Remember my sign-in info, then select Save.
Connect
Select Connect next to the new connection. Or press Windows key + A to open Quick Settings, select the VPN button and choose your connection.
To disconnect, return to the same place and select Disconnect.
Add a VPN connection
Windows 10
Support note: Windows 10 reached end of support on 14 October 2025. These steps still work, but moving to Windows 11 keeps your PC on current security updates.
Open the VPN settings
Select Start, then Settings (or press Windows key + I), and go to:
Network & Internet›VPNSelect “Add a VPN connection”
The Add a VPN connection dialog opens.
Fill in the connection details
Set VPN provider to “Windows (built-in)”, then enter the connection name, server name or address, VPN type and type of sign-in info — the same fields as in the Windows 11 illustration.
Save
Optionally add your user name and password, tick Remember my sign-in info, and select Save.
Connect
Select the network icon on the taskbar, choose your VPN connection, then select Connect. You can also connect from Settings › Network & Internet › VPN.
PowerShell (Windows 11 and 10)
Ideal for repeating the same setup on several PCs. Right-click Start and open Terminal (Windows 11) or Windows PowerShell (Windows 10). Commands that only affect your own user account do not need administrator rights.
Add an IKEv2 connection
PowerShellAdd-VpnConnection -Name "Office VPN" -ServerAddress "203.0.113.10" -TunnelType Ikev2 -EncryptionLevel Required -AuthenticationMethod Eap -RememberCredential
Or add an L2TP/IPsec connection with a pre-shared key
PowerShellAdd-VpnConnection -Name "Home VPN" -ServerAddress "203.0.113.10" -TunnelType L2tp -L2tpPsk "your-pre-shared-key" -AuthenticationMethod MSChapv2 -EncryptionLevel Required -Force
Connect
Windows asks for your user name and password if they are not saved.
PowerShellrasdial "Office VPN"
Check the status
PowerShellGet-VpnConnection -Name "Office VPN" | Select-Object Name, TunnelType, ConnectionStatus
Disconnect or remove
PowerShellrasdial "Office VPN" /disconnect Remove-VpnConnection -Name "Office VPN" -Force
Verify that the VPN is working
Look at the status
In Settings › Network & internet › VPN, the connection should read Connected. On recent Windows 11 versions, a small shield also appears on the network icon in the taskbar.
Check the network adapter
Open Terminal or Command Prompt and run
ipconfig. A section named after your VPN (for example “PPP adapter Office VPN”) with an IPv4 address confirms the tunnel is up.Confirm in PowerShell
Run the status command from the PowerShell tab.
ConnectionStatusshould showConnected.
C:\> ipconfig
PPP adapter Office VPN:
Connection-specific DNS Suffix . :
IPv4 Address. . . . . . . . . . . : 10.8.0.25
Subnet Mask . . . . . . . . . . . : 255.255.255.255
Default Gateway . . . . . . . . . :
Name TunnelType ConnectionStatus ---- ---------- ---------------- Office VPN Ikev2 Connected
Common errors and how to fix them
Windows shows a numbered error when a VPN connection fails. Find yours below.
| Error | What it usually means | What to try |
|---|---|---|
| 691 | The server rejected your sign-in. | Re-enter your user name and password. Some servers expect the format DOMAIN\user. |
| 789 | L2TP security negotiation failed. | Check that the pre-shared key or certificate exactly matches the server. |
| 809 | The VPN server could not be reached. | The network may block VPN ports (UDP 500/4500). Try another network, or SSTP if your server supports it. |
| 812 | A server-side policy blocked the connection. | Your account may not be allowed to use this VPN or sign-in method. Ask the server's administrator. |
| 868 | The server name could not be resolved. | Check the spelling of the server name, or use its IP address instead. |
| Connected, but no internet | Routing or DNS settings on the server. | Disconnect and reconnect. If it persists, the server may only route internal traffic (split tunnelling). |
Stay safe while connected
- Prefer IKEv2 or SSTP. Avoid PPTP, which is no longer considered secure.
- Keep Windows updated. VPN fixes arrive through Windows Update.
- Connect before you sign in to accounts on public Wi-Fi.
- Use strong, unique passwords and certificates where possible.
- Keep Windows Security on. A VPN does not replace antivirus or firewall protection.
- Only use servers you trust. The operator can see your connection metadata.
Frequently asked questions
Does Windows really include a VPN client?
Do I need administrator rights?
Add-VpnConnection does not need administrator rights. Connections available to all users of the PC (-AllUserConnection) do.Where do I get a server address?
Can I use WireGuard or OpenVPN with the built-in client?
Is it legal to use a VPN?
Will a VPN slow down my connection?
How do I remove a VPN connection?
Remove-VpnConnection -Name "Office VPN" in PowerShell.Ready to connect? Start at step 1.
Jump back to the instructions for your Windows version, or learn how the tunnel works and which protocol suits you best.