Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

My workplace has a sort of weird Internet connection. We have two connections, a DSL and a cable connection. Our server admin has it set up so that our router dynamically switches from one to another when the load gets too high. This effectively means that, to the outside world, my connection can have two IP addresses that switch between each other.

I often have to use SSH to log in to remote servers, but the connection doesn't stay alive long because after a while, I typically get bumped to the other outside connection. Is there a way I can set things up to prevent SSH from disconnecting?

share|improve this question
Is VRRF is configured on routers? It should stable link od only 1 provider and eliminate disconnections. – Paweł Borowski Aug 26 '15 at 9:21
You may want to look at Mosh – invert Aug 26 '15 at 11:14
up vote 3 down vote accepted

While potentially a fair bit of work and would require root access on the remote servers, you could set up an OpenVPN server outside the workplace network, connect the servers you need to work with as clients, and then connect yourself as a client with the -float option and using UDP as the protocol. This will allow your IP to change without disrupting the VPN tunnel, which will mask the fact that your IP is changing to SSH altogether.

As I suspect that SSH is not the only protocol that suffers from this setup, I would implore your admin to at least make the router ensure that once a connection is allocated to a WAN link, all traffic across that connection continues to be routed down that link. With the current setup, I would consider the connection no better than "broken". I would also ask that he or she enable sticky connections, so that all traffic to a remote host comes from a single WAN link, even if there are multiple connections. Some protocols (like FTP) use multiple connections, and might ignore the necessary auxiliary connections if they do not come from the expected host.

share|improve this answer

A quick workaround is to use screen on the remote server(s) to give you a session to which you can reconnect.

share|improve this answer

Lots of places have multiple Internet connections and don't suffer this problem. Your site has been configured wrong and can be improved. Your net admin needs to get some expert help, but it will probably take more than S.U. to fix it.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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