If you’ve ever lost your Remote Desktop Protocol (RDP) connection after connecting to a VPN on your Windows VPS, you’re not alone. This is a common issue, but it can be easily resolved by following these steps:
Step 1: Check Your Public IP Address
First, you need to identify your public IP address. You can find this by visiting the following link and looking under the "Your IP Address" line: Check Your IP Address.
Step 2: Open Command Line as Administrator
Next, open the Command Prompt (cmd) as an Administrator. To do this, search for "cmd" in the Start menu, right-click on it, and select "Run as administrator."

Step 3: Display Routing Table
In the Command Prompt, type the following command to display the current routing table:
route print
You should see a detailed list of routes. Look for the line associated with the VirtuozzoVirtIO Ethernet Adapter. In this example, the adapter’s ID is 5.
Step 4: Add a Static Route for RDP
To ensure your RDP connection remains active when connecting to a VPN, you need to add a new static route that directs RDP traffic directly to your public IP address. Use the following command, replacing the placeholders with your specific information:
route ADD 9.9.9.9 MASK 255.255.255.255 169.254.0.1 if 5
Here’s a breakdown of what each part of the command does:
- 9.9.9.9: This is your server’s IP address, the one you use to connect via RDP.
- 255.255.255.255: This is the netmask, which remains unchanged.
- 169.254.0.1: This is the link-local interface IP, also unchanged.
- 5: This is the ID of the VirtuozzoVirtIO Ethernet Adapter, which you identified in the previous step.
Step 5: Make the Route Persistent
If you want this route to remain active even after a reboot, you need to add the -p
flag to the command:
route -p ADD 9.9.9.9 MASK 255.255.255.255 169.254.0.1 if 5
Important Note
This method will ensure that your RDP connection is maintained when you connect to a VPN. However, it only works if you have a static IP address. If your IP address is dynamic and changes frequently, this solution will not be effective.