0

I have a server connected to Internet via two networks - A microwave link and an ADSL Link. The server has been assigned static IP address in both network.

Both both the networks are not reliable and get disconnected often. So whatever task I run from my client through ssh gets interrupted and I have to close everything and switch to the other connection.

Its frustrating to do this every time and hence I was wondering if there is a way that I can open a ssh connection that uses both the network in parallel, share the data transfer between the two and if there is any failure in one of the network,redirect the entire data traffic to the other in a way that my ssh doesn't get affected and I can seamlessly work without knowing which network the ssh is actually using?

This may be ridiculously senseless question but I am no networking expert.Please tell me if this is possible or please suggest me other ways to accomplish this, if any.

My server uses CentOS and my client is Ubuntu and Mac.

1 Answer 1

1

I'd suggest another tactic - While there are tools that allow for load balancing, it may not work for your use case as it is. I suggest having a session thats resilient to disconnections

Firstly, I'd run my commands in screen or tmux - that way your commands keep running even if you get disconnected. You can then log back in and re-attach the session. You want to do this in any scenario. You want screen installed on your servers. You start a ssh session (or a mosh session), start screen in that, and any tasks started in that session (or other screen sessions) will just keep running. You can even detatch the screen session to do other things, or completely quit your ssh session and come back to the screen session later.

I'd also suggest looking at mosh rather than plain vanilla ssh. Mosh is designed to let you roam between connections, and designed for high latency connections like yours. I'd use this with screen to be safe, but this should let you do what you want to do.

I'd be tempted to experiment with load balancing - I use dispatch proxy, which would switch over if a connection was bad but I'm not sure if this works with a ssh or mosh client. Either or both of the above suggestions would probably handle this cleanly, even with one bad connection.

3
  • Tmux and screen are the right way to go. I don't know if load balancing would really help. Load balancing only balances the load for both networks so that multiple connections are balanced over both networks which wouldn't help if the connection drops you're connected to or I am wrong?
    – Kimmax
    Commented Jul 7, 2014 at 6:36
  • The idea would be to use the load balancer to switch between connections till one works. Assuming it works reasonably, mosh might make this seem seamless. In his shoes, running tmux or screen is probably the first step I'd take, since it solves the tasks getting interrupted, and screen is standard/common on most linux systems I think
    – Journeyman Geek
    Commented Jul 7, 2014 at 6:55
  • Thank you @JourneymanGeek. Seems promising will try that out.
    – Vivek V K
    Commented Jul 7, 2014 at 9:43

You must log in to answer this question.

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