Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have the very strange behavior that my VPN-connection to a remote location "restarts" every couple of minutes when I logged on to the connecting machine via another VPN tunnel. When I sit in front of the machine everything is fine.

I wonder how this can be? How can an incoming connection through an VPN gateway influence the quality/state of an outgoing VPN connection at all?

So, while I doubt that anyone can solve my problem without further details, logfile analysis and careful retracing of steps, you might help me in explaining to me how technically it is at all possible that the VPN-connection is influenced at all? Where should I look for hints?


The normal and working scenario is like thus:

 +----+            +--------+      +--------+
 | PC | ===tun1=== | VPN-GW |      | Remote |
 +----+ ---ssh------>      ------->| Server |    Ok.
/______\ ========= |        |      |        |
                   +--------+      +--------+

When I log into the PC (ssh) via another VPN-GW the above VPN connection restarts every 1-3 minutes with a message on the console "Inactivity timeout (--ping-restart), restarting"!? Since I am using the connection all the time, and the connection breaks down even while typing on the remote server, it can't be a "real" timeout, can it?

+---------+              +----+
| VPN-GW2 | /==tun2===== |Home|
|        <--------ssh--- +----+
|         | \========== /______\
 +----+            +--------+      +--------+
 | PC | ==X=tun1=\ | VPN-GW |      | Remote |
 +----+ ---ssh------>      ------->| Server |    X: tun1 becomes unreliable!
/______\ =X======/ |        |      |        |
                   +--------+      +--------+

Home, PC, and Remote Server are all Ubuntu 12.04, The VPN GW are some linux boxes, I suppose. I use the openvpn standard ubuntu package.

share|improve this question

I came across something recently which could explain this. It seems that by default OpenVPN uses the same port for incoming and outgoing data, and, of-course, when acting as a server binds the port for outgoing data. This, combined with the fact that by default the server users UDP could be your problem.

You may be able to fix it by assigning a different port for your server (and, of-course, updating the client), or you might be able to get away with just specifying an "lport" parameter with a value other then 1195.

share|improve this answer
Good idea, I will try that. But I would guess it will not help, because the VPN is passed through a gateway. The "PC" is not the reciever of the VPN tunnel -- I go through the "VPN-GW" to the "PC" machine. – towi Oct 14 '13 at 9:22

How can an incoming connection through an VPN gateway influence the quality/state of an outgoing VPN connection at all?

VPNs change the routing table. When the second connection is started one of the route tables is almost certainly getting changed in a way that breaks your connection.

Look at the route table before and after the VPN connects. Look at your logs and you will see the routes that get added.

Once you know what changes then fire up traceroute if the solution isn't obvious.

share|improve this answer
No, its is not a second VPN session from the same machine. – towi Oct 14 '13 at 9:21

You must log in to answer this question.

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