> For the complete documentation index, see [llms.txt](https://docs.plenit.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.plenit.com/docs-en/productos/servers/how-to/how-to-configure-a-remote-access-vpn.md).

# How to Configure a Remote Access VPN Connection

A remote access VPN creates an encrypted tunnel between the server and the user's device over the Internet.

In this guide, you enable the VPN on the network, add the users, and configure the connection on a Windows device.

> #### 👍 What you get
>
> A working L2TP/IPsec VPN with its users, and a Windows client configured to connect securely without losing Internet access.

> #### 📘 NAT limit: one connection at a time
>
> Behind NAT, L2TP only supports one simultaneous connection per port it uses: a second user trying to connect through that same port will be rejected.
>
> If you need multiple connections from the same private network, set up [WireGuard](https://docs.plenit.com/docs-en/productos/servers/how-to/how-to-configure-wireguard-for-multiple-vpn-connections.md) instead.

### Before you begin

* Log in to the Plenit platform with an active organization.
* Have a subscription of **Servers** or **Remote Desktop** to enable the VPN on the network.
* Have access to the Windows device you will connect from.

### Step 1. Enable the VPN on the network

1. Enter the subscription of **Servers** from its card.
2. In the sidebar, open **VPN** and go to the subsection **Remote Access**.
3. Select the network you are going to use and change its status from **OFF** to **ON**.

With the network enabled, locate the two details you will need on the client:

* **Pre-Shared Key**: the shared key. You can see it with the eye icon in the column *Pre-Shared Key*.
* **public IP**: the address the VPN connection is established against.

![Enabling remote access VPN with the Pre-Shared Key and the public IP](https://3894148717-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxksPMyYRDCe4qKkhbpcY%2Fuploads%2Fgit-blob-cb5a9607b695fa314d7061c8d0fa6da31618cd23%2FCAPTURE%201%20%C2%B7%20Remote%20Access%20subsection%20with%20the%20network%20ON%2C%20the%20Pre-Shared%20Key%2C%20and%20the%20public%20IP.png?alt=media)

### Step 2. Create the remote access users

Click **New User**, enter the username and password with confirmation, and click **Accept**. The user is enabled for the *L2TP over IPsec*. Repeat for each person who will connect.

![Adding a remote access VPN user](https://3894148717-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxksPMyYRDCe4qKkhbpcY%2Fuploads%2Fgit-blob-c535db90e9759cd5db448f39bfaf5a061d09a02c%2FCAPTURA%202%20%C2%B7%20alta%20de%20un%20usuario%20de%20acceso%20remoto%20\(1\).png?alt=media)

> #### 📘 Two levels of authentication
>
> The **Pre-Shared Key** authenticates the network (it is common to the connection); the **username and password** authenticate each person. You need both on the client.

### Step 3. Configure the VPN on the Windows device

In **Settings → Network & Internet → VPN**, click **Add a VPN connection** and fill out the form:

| Field                  | Value                                      |
| ---------------------- | ------------------------------------------ |
| VPN provider           | `Windows (built-in)`                       |
| Connection name        | An identifying name                        |
| Server name or address | The **public IP** from Step 1              |
| VPN type               | `L2TP/IPsec with pre-shared key`           |
| Pre-shared key         | The **Pre-Shared Key** from Step 1         |
| Username               | The user from Step 2 (for example `user1`) |
| Password               | That user's password                       |

Click **Save**.

#### Adjust routing so you do not lose Internet access

In L2TP, Windows sends by default **all** traffic through the VPN, so the device may end up without Internet.

To avoid this, open **Control Panel → Network and Internet → Network and Sharing Center → Change adapter settings**. On the VPN, right-click → **Properties**.

In **Networking**, choose your stack (IPv4 or IPv6), click **Properties → Advanced options** and **disable** *Use default gateway on remote network*. Accept.

#### Adjust security

In **Properties → Security**, set **Data encryption** to *Require encryption (disconnect if server does not accept)*, keep enabled **Microsoft CHAP Version 2** and accept.

![Routing and security settings for the VPN connection in Windows](https://3894148717-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxksPMyYRDCe4qKkhbpcY%2Fuploads%2Fgit-blob-92330a4afabf0b73626627a65e2986f4c7b012d8%2FCAPTURA%203%20%C2%B7%20opci%C3%B3n%20de%20puerta%20de%20enlace%20predeterminada%20desactivada%20y%20par%C3%A1metros%20de%20seguridad%20\(4\).png?alt=media)

<figure><img src="https://3894148717-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxksPMyYRDCe4qKkhbpcY%2Fuploads%2Fgit-blob-f223d0fe51c19cde9684e3ce2eda8c2aa6b794b8%2FCAPTURA%203bis%20%C2%B7%20opci%C3%B3n%20de%20puerta%20de%20enlace%20predeterminada%20desactivada%20y%20par%C3%A1metros%20de%20seguridad%20(3).png?alt=media" alt=""><figcaption></figcaption></figure>

#### PowerShell alternative

If you're going to configure multiple devices, you can skip the entire GUI by creating the connection and split tunneling all at once. From PowerShell as administrator:

```powershell
# Create the L2TP/IPsec connection with the Pre-Shared Key
Add-VpnConnection -Name "Plenit VPN" -ServerAddress <PUBLIC-IP> `
  -TunnelType L2tp -L2tpPsk "<PRE-SHARED-KEY>" `
  -AuthenticationMethod MSChapv2 -EncryptionLevel Required -Force -RememberCredential

# Equivalent to disabling "use default gateway": you don't lose Internet access
Set-VpnConnection -Name "Plenit VPN" -SplitTunneling $true
```

### Validate the connection

Connect to the VPN from the network settings. If it connects, the device securely accesses the server's services. To check it from the terminal:

```powershell
Get-VpnConnection -Name "Plenit VPN"
rasdial "Plenit VPN" <user> <password>
```

### If something doesn't fit

| Symptom                                   | Likely cause                                | What to do                                                                                                                                              |
| ----------------------------------------- | ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| The device loses Internet when connecting | The default gateway is still active         | Disable it (or use `Set-VpnConnection -SplitTunneling $true`)                                                                                           |
| A second user does not connect after NAT  | L2TP supports one connection per port       | Use [WireGuard](https://docs.plenit.com/docs-en/productos/servers/how-to/how-to-configure-wireguard-for-multiple-vpn-connections.md) for multiple users |
| Authentication fails                      | Incorrect user, password, or Pre-Shared Key | Check the credentials from Step 2 and the PSK from Step 1                                                                                               |

### Conclusion

With this, your users connect to the server through an encrypted tunnel from their Windows device. Two details make the difference between it working or causing trouble: disabling the default gateway so you do not lose Internet access, and remembering that L2TP behind NAT is one user per port. If that limit is too tight, WireGuard is the way to go for multiple connections at once.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.plenit.com/docs-en/productos/servers/how-to/how-to-configure-a-remote-access-vpn.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
