Networking

Add or Change a VPN Connection in Windows 11 (Step by Step)

To add a VPN connection in Windows 11, open Settings, go to Network & internet > VPN > Add VPN, fill in the provider, name, server address, VPN type and sign-in type, then select Save. To change a connection later, select it in the same list, choose Advanced options and select Edit.

You need two details from your employer or VPN provider before you start: the server name or address, and the VPN type the server accepts. Everything else in the form either has an obvious value or follows from those two. The steps below follow Microsoft's own guide for Windows 11.

How to add a VPN connection in Windows 11

  1. Open Settings and go to Network & internet > VPN.
  2. Select Add VPN. The Add a VPN connection dialog opens.
  3. Set VPN provider to Windows (built-in).
  4. Type a name you will recognise in Connection name, for example Work VPN.
  5. Enter the address of the VPN server in Server name or address.
  6. Pick the protocol from VPN type.
  7. Pick Type of sign-in info (for example a username and password, a one-time password, a certificate or a smart card). If you chose username and password, enter them.
  8. Select Save.

The new connection appears in the VPN list. To use it, select Connect next to it, or click the network, volume or battery icon on the taskbar, choose VPN and connect from there. When it works, the word Connected appears under the connection name and a blue shield shows on the taskbar's network icon.

VPN settings are not available in Windows 11 SE. On that edition the page does not exist.

What each field in the VPN form means

FieldWhat to enter
VPN providerWindows (built-in). This is the client that ships with Windows. Apps from commercial VPN services usually bring their own client and do not use this form.
Connection nameAny label. It is only shown to you, so it does not have to match the server.
Server name or addressThe host name, IPv4 address or IPv6 address of the VPN server, exactly as your administrator or provider gave it.
VPN typeThe protocol the server speaks. Microsoft's page says to choose the type your company or VPN service uses and does not choose one for you.
Type of sign-in infoHow you prove who you are: username and password, one-time password, certificate or smart card.

Most failed first attempts come from a wrong VPN type or a typo in the server address. Those two values must match what the server is configured for, and Windows cannot guess them from the address alone.

How to change or edit a VPN connection

  1. Go to Settings > Network & internet > VPN.
  2. Select the connection you want to change.
  3. Select Advanced options.
  4. Select Edit next to the detail you want to change, such as the proxy settings or the server address.
  5. Select Save (or Apply, depending on the page).

Microsoft's guide lists proxy settings as an example of what you can edit from this page. Settings changed here apply to that one connection only, not to the other saved VPNs.

Add or change a VPN connection with PowerShell

The built-in VPN client can also be managed from PowerShell with the VpnClient module. This is useful when you need the same profile on several PCs or want to script a change. Run these in a normal PowerShell window.

Add a connection

Add-VpnConnection -Name "Work VPN" -ServerAddress "vpn.example.com" -TunnelType "Automatic" -PassThru

Only -Name and -ServerAddress are mandatory. The server address can be a URL, an IPv4 address or an IPv6 address. -TunnelType accepts Pptp, L2tp, Sstp, Ikev2 or Automatic. -PassThru prints the profile that was created; without it the command prints nothing.

Example output, adapted from Microsoft's documentation for a connection created with just a name and address:

Name                  : Test1
ServerAddress         : 10.1.1.1
AllUserConnection     : False
TunnelType            : Automatic
AuthenticationMethod  : {MsChapv2}
EncryptionLevel       : Required
L2tpIPsecAuth         : Certificate
UseWinlogonCredential : False
ConnectionStatus      : Disconnected
RememberCredential    : False
SplitTunneling        : False

The defaults shown there are worth knowing. Without extra switches the profile uses MS-CHAPv2 authentication, required encryption, no saved credentials and no split tunneling.

Useful options when adding a connection

  • -AuthenticationMethod takes Pap, Chap, MSChapv2, Eap or MachineCertificate.
  • -EncryptionLevel takes NoEncryption, Optional, Required, Maximum or Custom.
  • -RememberCredential stores the credentials from the first successful connection in the cache.
  • -SplitTunneling sends only traffic for the company network through the VPN. Traffic to destinations outside the intranet does not flow through the tunnel. Leave it off and all traffic goes through the VPN.
  • -AllUserConnection puts the profile in the global phone book so it is available to every user of the PC, not only you.
  • -L2tpPsk supplies a pre-shared key for L2TP. If you omit it, a certificate is used for L2TP. Microsoft notes that -Force is how you confirm the key is being supplied over an insecure channel, so avoid typing a real key into a script that is saved on disk.

Change a connection

Use Set-VpnConnection with the name of the existing profile. For example, to point it at a different server:

Set-VpnConnection -Name "Work VPN" -ServerAddress "vpn2.example.com" -PassThru

Switches in this cmdlet take Boolean values rather than being bare flags, so turning on split tunneling looks like this:

Set-VpnConnection -Name "Work VPN" -SplitTunneling $True

If the profile does not exist, the cmdlet returns an error. If the profile was created with -AllUserConnection, add -AllUserConnection to the change command as well, so it looks in the global phone book. The cmdlet documents no parameter for renaming a profile, so to rename a connection, add a new one and remove the old one.

Remove a connection

Remove-VpnConnection -Name "Work VPN" -Force

Per Microsoft's documentation, -Force suppresses warnings and non-terminating errors. Add -AllUserConnection if the profile lives in the global phone book. Microsoft's Windows support page does not describe a Settings-based removal procedure, which is why the cmdlet is shown here.

Work accounts and company VPN profiles

Your employer may deliver a VPN profile to the PC instead of asking you to type one in. Microsoft's guide says you can set up a work account to receive a VPN profile from your company as an alternative to creating one by hand. For work VPN details, the guide points to your company intranet or your support contact. If a managed profile is present, changes you make by hand may be overwritten or blocked, so talk to your administrator first.

If the connection still fails

  • Check the server address first. A single wrong character in the host name is the quickest thing to rule out. Open the connection under Advanced options and compare it to what you were given.
  • Check the VPN type. If you picked a protocol the server does not accept, the connection will fail no matter how correct the credentials are. Ask the provider, or try Automatic through PowerShell with Set-VpnConnection -Name "Work VPN" -TunnelType "Automatic".
  • Check the sign-in type. A server that wants a certificate will not accept a username and password, and the reverse.
  • Look at the encryption warning. Microsoft's Set-VpnConnection examples show that combining Optional encryption with Pap authentication prints: WARNING: The currently selected encryption level requires EAP or MS-CHAPv2 logon security methods. Data encryption will not occur for Pap or Chap. If you see that, your traffic is not being encrypted.

If you want to understand what the connection actually does once it is up, how the tunnel and the encryption work is covered in How Does a VPN Work?. If you are deciding whether you need a VPN at all, Proxy vs VPN compares it with a proxy.

Frequently asked questions

Where is the VPN setting in Windows 11?
Open Settings and go to Network & internet, then VPN. The Add VPN button, the list of saved connections and the Advanced options for each connection are on that page. VPN settings are not available in Windows 11 SE.
What VPN type should I choose when adding a connection?
Choose the type your employer or VPN provider tells you to use. Microsoft's guide does not pick one for you, because the type must match what the server accepts. If you do not know it, ask the provider, or use Automatic in PowerShell so Windows tries the supported tunnel types.
Can I add a VPN connection without a company or provider?
The built-in client only connects to a VPN server you already have access to, such as a work gateway, a router that hosts a VPN, or a provider that supports the built-in Windows client. Windows does not supply a server or an address for you.
How do I change the server address of an existing VPN?
In Settings, open Network & internet, then VPN, select the connection, choose Advanced options and select Edit. In PowerShell, run Set-VpnConnection with the profile name and a new -ServerAddress value.

Sources