Hi Everyone :)

Today, I want to share a method to self-host and set up a VPN for LAN video games over the internet. Yes, you can use ZeroTier, Hamachi, GameRanger, or Radmin VPN, but if you want to host your own VPN, follow the steps below.

What’s cool about this method is that it works on old games that don’t support or have a console to directly connect to the host IP. Even more interesting, if your friends are on the same ISP, you can connect to each other if the internet is down (due to governmental orders like what happens here in Iraq during school exams to prevent leaks).

Before we start, it’s important to mention that video games use broadcasting to advertise their game session hosts to everyone on the same subnet network. However, if your subnet mask is 255.255.255.255, which is common in P2P connections like L2TP, Wireguard, and PPTP VPNs, there’s no space in the subnet for the game to broadcast itself. You could use 255.255.255.0 with OpenVPN, but the problem with OpenVPN is that it won’t push its default gateway to the connected clients. Even if it does, there’s only a 50% chance that the game will detect the host server.

This method fixes that problem, allowing you to specify any default gateway and IP range, and push any routes whenever a client connects.


The Software

The software used is called SoftEther. You can download the server and client software from this link.

  • Server Supported Platforms: Windows, FreeBSD, Linux, Solaris, and macOS.
  • Client Supported Platforms: Windows, Linux, and macOS.

My Setup

  • Server: Windows
  • Clients: Windows

This guide is tailored for new Windows users. If you’re using Linux, you probably know what to do.


Server Setup

Step 1: Install SoftEther VPN Server Manager

  1. Download SoftEther VPN Server Manager for Windows and install it.

Step 2: Set Up the Server Manager

  1. When running the Server Manager for the first time, set a password for your localhost server. Remember it!
    • Note: If you encounter problems during installation (e.g., due to disk size, wrong install directory, or power down while installing), uninstall the software and delete its directory from the disk. If you keep the directory, the password will still exist even if you reinstall the Server Manager multiple times or on another drive.

Step 3: Configure the Virtual Hub

  1. Select your localhost server > Connect > Manage Virtual Hub > Manage Users.
  2. Set a username and password and check Set Security Policy.
  3. Edit the Security Policy for this specific user and any other user that will connect to this server.
  4. Click on Unlimited Number of Broadcasts and enable it.
  5. Check Maximum Number of TCP Connections and set it to 32.

Step 4: Enable SecureNAT

  1. Go to Manage Virtual Hub > Virtual NAT and Virtual DHCP Server (SecureNAT).
  2. Enable SecureNAT and click on SecureNAT Configuration.
  3. Check Use Virtual DHCP Server Functions and uncheck Use Virtual NAT Function.
    • Note: At this point, clients will lose internet connection but will remain connected to your VPN. You can use TeamSpeak or any other VoIP software that relies on local connections, not online servers like Discord.

Step 5: Configure DDNS

  1. Click on Edit Config in the SoftEther VPN Server Manager GUI.
  2. Save to File.
  3. Edit the configuration file:
    declare DDnsClient
    {
        bool Disabled false
    }
    
    Change it to:
    declare DDnsClient
    {
        bool Disabled true
    }
    
  4. Save the file, import it back, and apply the changes using the same GUI where you saved the file from.

Client Setup

Step 1: Install SoftEther VPN Client Manager

  1. Download SoftEther VPN Client Manager and install it.

Step 2: Create a VPN Connection

  1. Click on Add VPN Connection from the client manager interface.
  2. This will create a new network adapter that handles all your traffic for gaming. Name it VPN, VPN2, VPN25, or any variation you like.

Step 3: Configure the VPN Connection

  1. Click on Add VPN Connection again.
  2. Start entering the VPN server details:
    • Host Name: Enter the server’s public IP. To get the public IP, open a browser on the PC where you installed and hosted the VPN server, search for “what’s my IP,” or use this link to find your IPv4 address.
    • Enter the IP in the Host Name field.
    • Change the Port Number to 5555.
    • The Virtual Hub Name should be DEFAULT. If it�s not automatically selected, type DEFAULT.
    • Enter the username and password you created in the Server Manager under User Authentication Setting.
  3. Click OK.
  4. Right-click on the VPN connection in the client interface and select Connect.
    • Note: If you encounter connection issues, edit the VPN you created in the client interface by right-clicking on it and selecting Properties. Under Server Certificate Verification Option, check Always Verify Server Certificate.

Now, you should be connected to the VPN server and have your own private IP for your machine. You can edit that IP like a normal network adapter if you like.

As mentioned before, you may lose internet connectivity because of the metric of 2 for the VPN, but you will remain connected to the VPN. You can now join the TeamSpeak server hosted on the server machine or the client machine.

Tested Games

The following games have been tested and confirmed to work using this self-hosted VPN setup for LAN gaming:

  • Counter-Strike: Global Offensive
  • Counter-Strike 2
  • Counter-Strike: Source
  • Counter-Strike 1.6
  • Medal of Honor: Allied Assault
  • Call of Duty 1
  • Call of Duty: Black Ops 2
  • Call of Duty: World at War
  • Minecraft: Java Edition
  • Valheim
  • Sven Co-op (Half-Life 1)
  • Half-Life 2 (using Synergy)
  • Alien Swarm: Reactive Drop
  • Dying Light 1
  • Insurgency: Sandstorm
  • Need for Speed: Underground 2
  • Rainbow Six: Vegas
  • Rainbow Six: Vegas 2

Happy Gaming!