I've set up a PPTP VPN using Amazon EC2. I did that by following this guide. I don't want everything going through the VPN, and instead only want connections to specific IP addresses to go through the VPN. I accomplished that by unticking "Use default gateway on remote network" in the VPN's properties, and then using the "route add" command from the command prompt to direct those specific IPs through the VPN. This all works perfectly fine.

The problem I have is that after an extremely short time (perhaps 30 seconds to 2 minutes), the connection suddenly just "dies". Windows still displays that it is connected to the VPN, but the connection no longer works. I can no longer connect to the specified IP addresses, and even attempts to ping the VPN (using the server IP address displayed in the detailed window for the VPN) just timeout. It simply does not work. Disconnecting from the VPN and reconnecting fixes this issue, and allows me to connect through it again — until a minute or so later, when it just dies yet again.

I have done some searching on the internet, but all I have been able to find are posts from random people, vaguely referring to a "dead connection bug" without expanding on that in any detail.

When I am actively using the connection, the problem is either non-existent, or at least happens a lot less often. If I leave it idle for a minute or so, it's almost guaranteed to be dead when I try to use it again. I therefore suspect that the problem is that there needs to be some "keep alive" packets sent, and Windows isn't doing this for me.

So, my questions are:

  • Does anybody know anything about this issue, and what the cause is?
  • How can I fix this issue?
  • If I switched my VPN from using PPTP, to instead a different type such as L2TP, SSTP, OpenVPN, or even just a basic SSH tunnel with PuTTY, would I still have this issue or would it be resolved?
  • Try (as a test) ping -t (something across the vpn) and see if keeping active traffic is really the differentiator. I have left Win 7 to Linux PPTP connected and largely idle for weeks without issue, so it's hard to say that a different protocol would necessarily fix the underlying issue. EC2's network infrastructure, like many others, will eventually "forget" very idle connections, but not in a couple of minutes. – Michael - sqlbot Jul 14 '14 at 0:12
  • @Michael - Thanks for your comment. I tried what you suggested, and it has shown that keeping active traffic is indeed the differentiator, as I suspected. I've had the ping going continually for two hours, without doing anything else over the connection. I tried it now and the VPN connection is still working perfectly. None of the pings timed out or failed. I then stopped the ping, and a couple of minutes later the connection was dead. What could be causing this? – John Smith Jul 14 '14 at 19:00

I finally found a solution to this. It seems that it was actually an issue on the Amazon side rather than on Windows. To solve it, I edited the /etc/ppp/options.pptpd file and added the following lines:

lcp-echo-failure 30
lcp-echo-interval 5

Now the VPN works fine and it stays connected with no problems.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.