Setting up a VPN server on a Windows Server 2022-based KVM VPS offers secure remote access, improves privacy, and provides secure browsing capabilities. This guide will walk you through the process step-by-step.
Prerequisites:
- KVM VPS running Windows Server 2022.
- Administrator access to the VPS.
- Basic networking knowledge and familiarity with Windows Server management.
Step-by-Step Setup Guide:
1. Connect to Your VPS
- Use Remote Desktop Protocol (RDP) to connect to your Windows Server 2022 VPS.
- Log in using your administrator account credentials.
2. Install the Remote Access Role
- Open Server Manager.
- Select Manage > Add Roles and Features.
- Choose Role-based or feature-based installation and click Next.
- Select the target server and click Next.
- On the Select server roles screen, check Remote Access and click Next.
- Click Next until you reach the Role Services page.
- Check DirectAccess and VPN (RAS) and click Next.
- Complete the installation by clicking Install and waiting for the process to finish.
3. Configure Routing and Remote Access (RRAS)
- Open Server Manager and navigate to Tools > Routing and Remote Access.
- Right-click on your server’s name and select Configure and Enable Routing and Remote Access.
- In the wizard:
- Select Custom configuration.
- Choose VPN access and click Next.
- Click Finish.
- Right-click on the server again and select Start service.
4. Allow VPN Ports Through the Firewall
- Make sure your VPS firewall settings allow incoming traffic on port 1723 (used for PPTP VPN) and port 47 (for the GRE protocol).
5. Configure IP Address Assignment for VPN Clients
- In the Routing and Remote Access window, right-click on your server and choose Properties.
- Go to the IPv4 tab.
- Select Static address pool and click Add.
- Enter a range of IP addresses to be assigned to VPN clients (e.g.,
192.168.100.1
to192.168.100.20
). - Click OK to save the settings.
6. Create a User Account for VPN Access
- Open Computer Management (accessible via Server Manager > Tools).
- Click Local Users and Groups > Users.
- Right-click Users and select New User.
- Enter a username and password for the new user. Uncheck User must change password at next logon.
- Click Create.
- Right-click on the newly created user, go to Properties, select the Dial-in tab, and set Network Access Permissionto Allow access.
7. Connect to Your VPN from a Client Device
- On a client device (e.g., a PC, laptop, or mobile device), set up a new VPN connection.
- Use the public IP address of your KVM VPS and the user credentials you created in the previous step.
Common Troubleshooting Tips:
- Ensure the necessary VPN ports are not blocked by your VPS provider’s firewall or internal firewall settings.
- Verify that you are using the correct user credentials for VPN access.
- Double-check your network interface and routing configuration to avoid conflicts.