2

I have a SSH disconnection problem, disconnection occurs randomly. Sometimes, it works fine and other times I am frequently disconnected. After the disconnection I can again re-connect and continue to work.

Between the client to destination server ssh connectivity the flow is like this:

  Client (C1)   ->   Intermediate Server (I)   -> Destination Server (R1)
(Windows/Linux) -> (Linux + OpenVPN/IPTables)  ->         (Linux)    

Routing from Client C1 to destination server R1always happens through intermediate server I.

With Wireshark, I could see the RST packets I'm getting whenever I have a disconnection issue. Wireshark logs on C1 shows R1 is sending RST tcp pakets whenever I get a disconnection problem.

What could be causing this issue?

1
  • Can you capture on (I) and on (R1)? Which of those is really sending the RST packets?
    – joechip
    Jul 15, 2011 at 4:07

2 Answers 2

1

Without delving into your particular problem, I've found these configuration lines have solved similar issues for me:

ClientAliveInterval 150
ClientAliveCountMax 10

It solves disconnects due to laggy or flapping links. I'm not saying these are perfect values, but they have worked for me so far.

1
  • I found that keepalives actually exacerbated disconnects on poor quality connections. The connection would drop because the keepalive failed. Without it, the period of congestion would go unnoticed as the link was not transmitting. In other situations where the firewall state table would eventually purge, keepalives helped the SSH connection remain in the state table.
    – Jodie C
    Jul 22, 2011 at 18:30
1

Turn on keepalive. Add the following line to your .ssh/config:

ServerAliveInterval 60

You must log in to answer this question.