3

I have a Virtual Private Server that runs Windows Server 2008 R2. I use Remote Desktop Connection to administer it. I am trying to connect my VPS to a VPN. The connection succeeds, but since the VPS gets a new IP, the existing RDP connection is dropped.

I tried to quit and connect again, but that failed due to the server now having a new IP address on the VPN. I can't connect using the new IP since that IP can be connected with many computers.

So to connect to my VPS using the existing VPN connection I tried the following tools:

  1. Ammyy Admin: Freezes, black screen, requests authentication again and again.
  2. TeamViewer: Not supported on free version, failed to connect.

Are there any solutions to connect to my VPS while it's connected to the VPN, or to maintain the existing RDP connection even after it is connected to the VPN?

EDIT: Now I'm using OpenVPN based connection by BolehVPN. Therefore, I can't find a way to use WesleyDavid's answer. So still looking for OpenVPN - Windows based tweak.

2 Answers 2

2

You could try LogMeIn. I can't say I've used it in your particular situation, but I imagine it would work ok.

Also, I think your problem is with routing back from the VPS to your machine (you connect to the VPS on one IP, it replies from another IP). If you give the VPS a static route to your machine via the main ethernet interface using the original IP (as the new VPN IP shouldn't replace the original IP, just add to it), it should work ok. If you're on DHCP from your ISP then add their entire IP range as you probably aren't going to be using the VPS to connect to another IP from your ISP.

3
  • LogMeIn access remote computer from a webpage. But the webpage seems a subdomain of their main site; This method also don't work as it returns "Page loading interrupted" error. So its also fail on VPN.
    – Jones
    Oct 8, 2011 at 18:32
  • It's supposed to be from a subdomain, that's fine. Did you try connecting after the page loading interrupted? The logmein program installed on the server will connect to logmein and report it's IP address every couple of minutes, so it should still work, even if you get failures for a couple of minutes after enabling the VPN. Oct 10, 2011 at 11:47
  • (Also, setting static routes on the server will almost certainly fix the RDP issue if you didn't want to use a 3rd party tool like logmein.) Oct 10, 2011 at 11:48
2

You will likely want to set your VPN connection to not use the remote VPN endpoint as your default gateway. When it is set to use the VPN endpoint as the default gateway, all network traffic no matter its origin will go to the VPN. If the VPN is not set as the default gateway then only traffic bound to the VPN's subnet will travel over that tunnel and the IP address that you've connected to through RDP will not be wrapped by the VPN.

Here's a blog post that shows the nitty gritty of changing the default gateway settings on your VPN.

EDIT:

In the case of needing the IP of the endpoint after it is connected to the VPN, I would suggest finding out how IP addresses are provisioned for the VPN. Set up a DHCP server and then use DHCP reservations to give the same IP to that incoming VPN connection. If that VPS is the only connection to the VPN, then you can make a DHCP range that covers only one IP address. If the VPN endpoint receives a private IP address, you'll have to either have the VPN endpoint provision public IPs for VPN clients or modify the VPN endpoint's firewall to forward traffic on certain ports to the private IP address of the connected VPS.

EDIT 2:

The DHCP server in question would likely be on the same machine as the VPN endpoint itself. YOu can either use the VPN endpoint software itself or install a DHCP server on the same server as the VPN software. VPN solutions usually have IP addressing capabilities built into them or they hand it off to a DHCP server that is on the network (which can also be on the same server).

Your VPS will be connecting to the VPN endpoint, but will now need an address assigned to it by the VPN. That's the side of the tunnel that will need to have the DHCP service on it.

2
  • Actually I need the VPN's IP. I'm using VPS for speed file transfers and VPN for accessing country restricted sites. So unchecking the default gateway is not feasible solution for me. Further this thing seems don't support in OpenVPN too.
    – Jones
    Oct 6, 2011 at 10:35
  • The DHCP server part is confusing. You mean to setup a DHCP on my VPS itself? Please be a little bit elaborate.
    – Jones
    Oct 8, 2011 at 18:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .