Here’s a step-by-step tutorial for setting up a VPN server on a Windows Server 2022-based KVM VPS:
Setting up a VPN (Virtual Private Network) on your Windows Server 2022 KVM VPS can be a great way to securely access resources, mask your IP address, or bypass network restrictions. Here’s how to set up a basic VPN server quickly.
Prerequisites:
- A KVM VPS running Windows Server 2022.
- Administrator access to your VPS.
- Basic networking knowledge.
Step-by-Step Guide:
1. Connect to Your VPS
- Use Remote Desktop Protocol (RDP) to connect to your Windows Server 2022 VPS.
- Log in using your administrator credentials.
2. Install the Remote Access Role
- Open Server Manager.
- Click on Manage > Add Roles and Features.
- In the wizard, select Role-based or feature-based installation and click Next.
- Select your server from the server pool and click Next.
- On the Select server roles page, check the box for Remote Access and click Next.
- Click Next until you reach the Role Services section.
- Check DirectAccess and VPN (RAS) and click Next.
- Complete the installation by clicking Install. This process might take a few minutes.
3. Configure the VPN Server
- Open Server Manager again, go to Tools > Routing and Remote Access.
- In the Routing and Remote Access window, right-click your server name and select Configure and Enable Routing and Remote Access.
- In the wizard:
- Select Custom configuration.
- Check VPN access and click Next.
- Click Finish.
- Right-click the server again and select Start service.
4. Configure VPN Ports
- Make sure your VPS firewall allows incoming traffic on port 1723 (used for PPTP VPN) and port 47 (GRE protocol).
5. Configure IP Address Assignment
- In the Routing and Remote Access window, right-click on your server, and select Properties.
- Go to the IPv4 tab.
- Select Static address pool, then click Add.
- Enter a range of IP addresses that your VPN clients will use (e.g.,
192.168.100.1
to192.168.100.20
). - Click OK.
6. Add a User for VPN Access
- Open Computer Management (from Server Manager > Tools).
- Click on Local Users and Groups > Users.
- Right-click on Users and select New User.
- Create a new user with a username and password. Make sure to uncheck User must change password at next logon.
- Click Create.
- Go to the Properties of the user you just created, click on the Dial-in tab, and select Allow access for Network Access Permission.
7. Connect to Your VPN
- On a client device, add a new VPN connection using the public IP address of your KVM VPS.
- Use the credentials created in the previous step.
Troubleshooting Tips:
- Ensure the ports needed for VPN are not blocked by your VPS provider’s firewall or your internal firewall.
- Double-check your user credentials.
- Make sure your VPS’s network interface is properly configured.
Conclusion
Setting up a VPN server on your Windows Server 2022 KVM VPS offers a robust solution for secure connections. Following this guide, you should have your VPN service up and running quickly.