How to Configure WireGuard for Multiple VPN Connections from a Private Network
When multiple users connect from the same private network behind NAT, L2TP only supports one concurrent session.
In this guide you install WireGuard, an encrypted-tunnel VPN, to accept multiple clients at once without exposing them to the Internet.
👍 What you get
A WireGuard server in your subscription accepting multiple simultaneous connections from a private network, with the port open in the Plenit firewall.
Why WireGuard
L2TP behind NAT collapses all connections from the same public network into a single session. WireGuard works over UDP and treats each client as an independent peer with its own key pair, so multiple users on the same network connect without interfering with one another.
The key model is like SSH: each end has a private key (which it keeps) and a public key (which it shares with the other side).
Before you begin
Log in to the Plenit platform with an active organization.
Have a subscription of Servers or Remote Desktop with a Linux server.
Have the client machine ready where you will install WireGuard.
Step 1. Install WireGuard on the Linux server
Installation varies depending on the distribution. On CentOS, as root user:
yum install yum-utils epel-release
yum-config-manager --setopt=centosplus.includepkgs=kernel-plus --enablerepo=centosplus --save
sed -e 's/^DEFAULTKERNEL=kernel$/DEFAULTKERNEL=kernel-plus/' -i /etc/sysconfig/kernel
yum install kernel-plus wireguard-tools
rebootOn Ubuntu, the base command is:
Generate the server key pair: the private key stays on the server and the public key will be used by the clients.
Step 2. Install the client
In this example the client is Windows. Download the installer from the WireGuard website and run it as administrator. If the main installer fails, use the Windows client MSI package.
{/* 📸 CAPTURE 1 · WireGuard window after installation on the client */}

Step 3. Create the tunnel on the client
With WireGuard open, click Add Tunnel → Add empty tunnel…. The client generates its key pair and shows an initial configuration that you complete with this structure:
PrivateKey
Client private key
Address
Client internal IP inside the tunnel (a private range, e.g. 10.0.0.2/32)
DNS
Network DNS server
PublicKey
WireGuard server public key
AllowedIPs
What traffic is routed through the VPN. With 0.0.0.0/0 everything goes through; with a specific subnet, only that one
Endpoint
Public IP and port of the server (UDP 51820)
{/* 📸 CAPTURE 2 · tunnel configuration completed on the client */}

Step 4. Register the client on the server
The server only lets through the clients it knows. Add the client to the [Peer] section of the server configuration, or on the fly with:
Where <CLIENT_PUBLIC_KEY> is the key generated by the client and <CLIENT_INTERNAL_IP> the internal IP it will use in the tunnel (the same Address from Step 3).
Step 5. Open the port in the Plenit firewall
WireGuard listens on UDP 51820. Without that port open, the client will not connect even if the tunnel is configured correctly. In the Servers subscription, click New rule and configure it:
Select the network through which the service connects.
Define the source of the connections. If possible, filter the allowed IPs instead of opening it to all of them.
Protocol UDP.
Public IP through which WireGuard connects.
Public port 51820.
Corresponding private IP and port.
{/* 📸 CAPTURE 3 · firewall rule with UDP protocol and port 51820 */}

👍 Filter the source whenever you can
Restricting source IPs in the rule reduces exposure compared to leaving the port open to the entire Internet.
Step 6. Verify the connection
Activate the tunnel on the client. On the server, confirm that there is a handshake with each peer:
A latest handshake recent and counters of transfer that increase indicate that the tunnel is active. From the client, also check that you are exiting with the server's public IP.
If it doesn't come up, check:
The server and client public keys are correctly exchanged.
The client is registered on the server (section
[Peer]orwg set).The Plenit firewall allows UDP 51820.
The
Endpointpoints to the correct public IP of the server.
Limitations and security
This guide solves the L2TP session limit when several users share a private network behind NAT.
WireGuard is not enough to just install it: each client must be registered on the server and UDP port 51820 opened.
With
AllowedIPs = 0.0.0.0/0, all client traffic goes through the VPN.Filtering the source in the firewall reduces the exposure surface.
Conclusion
With WireGuard deployed, a private network behind NAT is no longer limited to a single session: each user connects as their own peer.
The key to the deployment is three pieces that must fit together: the keys correctly exchanged between client and server, the peer registration on the server, and UDP port 51820 open. To add more clients, repeat the tunnel setup on the client (Step 3) and its registration on the server (Step 4).
Last updated
Was this helpful?

