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.

Windows 11 · Windows 10 · PowerShell
Step 0

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).
Instructions

Choose your Windows version

Not sure which one you have? Press Windows key + R, type winver and press Enter.

Windows 11

  1. Open the VPN settings

    Press Windows key + I to open Settings, then go to:

    Network & internet›VPN
  2. Select “Add VPN”

    Next to VPN connections, select Add VPN. A dialog opens.

  3. 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.

  4. Save

    Optionally enter your user name and password and tick Remember my sign-in info, then select Save.

  5. 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.

Illustration with example values — use the details for your own VPN server.
After step 5: the status changes to “Connected”.

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.

  1. Open the VPN settings

    Select Start, then Settings (or press Windows key + I), and go to:

    Network & Internet›VPN
  2. Select “Add a VPN connection”

    The Add a VPN connection dialog opens.

  3. 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.

  4. Save

    Optionally add your user name and password, tick Remember my sign-in info, and select Save.

  5. 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.

  1. Add an IKEv2 connection

    PowerShell
    Add-VpnConnection -Name "Office VPN" -ServerAddress "203.0.113.10" -TunnelType Ikev2 -EncryptionLevel Required -AuthenticationMethod Eap -RememberCredential
  2. Or add an L2TP/IPsec connection with a pre-shared key

    PowerShell
    Add-VpnConnection -Name "Home VPN" -ServerAddress "203.0.113.10" -TunnelType L2tp -L2tpPsk "your-pre-shared-key" -AuthenticationMethod MSChapv2 -EncryptionLevel Required -Force
  3. Connect

    Windows asks for your user name and password if they are not saved.

    PowerShell
    rasdial "Office VPN"
  4. Check the status

    PowerShell
    Get-VpnConnection -Name "Office VPN" | Select-Object Name, TunnelType, ConnectionStatus
  5. Disconnect or remove

    PowerShell
    rasdial "Office VPN" /disconnect
    Remove-VpnConnection -Name "Office VPN" -Force
Check your work

Verify that the VPN is working

  1. 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.

  2. 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.

  3. Confirm in PowerShell

    Run the status command from the PowerShell tab. ConnectionStatus should show Connected.

Example output — ipconfig
C:\> ipconfig

PPP adapter Office VPN:

   Connection-specific DNS Suffix  . :
   IPv4 Address. . . . . . . . . . . : 10.8.0.25
   Subnet Mask . . . . . . . . . . . : 255.255.255.255
   Default Gateway . . . . . . . . . :
Example output — Get-VpnConnection
Name       TunnelType ConnectionStatus
----       ---------- ----------------
Office VPN      Ikev2        Connected
Examples only — your addresses will differ.
Troubleshooting

Common errors and how to fix them

Windows shows a numbered error when a VPN connection fails. Find yours below.

Common Windows VPN error codes
ErrorWhat it usually meansWhat to try
691The server rejected your sign-in.Re-enter your user name and password. Some servers expect the format DOMAIN\user.
789L2TP security negotiation failed.Check that the pre-shared key or certificate exactly matches the server.
809The 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.
812A 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.
868The server name could not be resolved.Check the spelling of the server name, or use its IP address instead.
Connected, but no internetRouting or DNS settings on the server.Disconnect and reconnect. If it persists, the server may only route internal traffic (split tunnelling).
Good practice

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.
FAQ

Frequently asked questions

Does Windows really include a VPN client?
Yes. Windows 11 and Windows 10 include a VPN client that supports IKEv2, SSTP, L2TP/IPsec and the legacy PPTP. You manage it in Settings or with PowerShell.
Do I need administrator rights?
Not usually. A connection added for your own account through Settings or Add-VpnConnection does not need administrator rights. Connections available to all users of the PC (-AllUserConnection) do.
Where do I get a server address?
From whoever operates the VPN server: your organisation's IT team, your own router or server configuration, or the VPN service you use.
Can I use WireGuard or OpenVPN with the built-in client?
No. Those protocols are not part of the built-in Windows client and need a separate client app from the service or project that provides them.
Is it legal to use a VPN?
In most countries, yes. Some countries restrict or regulate VPNs, and some websites limit VPN access in their terms. Always follow the laws and rules that apply to you.
Will a VPN slow down my connection?
Usually a little, because traffic is encrypted and takes an extra trip to the server. A server close to you and a modern protocol like IKEv2 keep the impact small.
How do I remove a VPN connection?
Go to Settings › Network & internet › VPN, expand the connection and select Remove, or run 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.