Port Forwarding over Unreliable Connections

From: Gregory Novak (novak_at_ucolick.org)
Date: 11/22/05


Date: Mon, 21 Nov 2005 16:01:06 -0800

I make extensive use of ssh port forwarding to access machines behind
firewalls, etc. I often run programs that require presistent
connections over these ports (such as X11 programs). Unfortunately my
home DSL connection has become unreliable lately, going down for a few
minutes and then coming back. This often has the effect of killing
the programs that rely on the forwarded connections.

I would much prefer it if the forwarded connections behaved more like
plain vanilla TCP connections--if the network goes down, they should
patiently wait a long time before finally snipping the connection.

Ideally, this would even include starting a new ssh process to handle
the port forwarding. My understanding of ssh port forwarding is that
ssh simply catches the TCP packets at one end, shoots them over the
secure connection, and allows them to pop out at the other end.
Therefore it doesn't seem like it would be impossible to, for example,

1) start an xterm on a remote machine, forwarding the X11 connection
over the SSH connection so that its window pops up on the local
machine.
2) Kill the SSH process.
3) Start a new SSH process, forwarding the same ports that were
forwarded by the first SSH process
4) Happily use the Xterm as though nothing happened.

In my experience, the Xterm always dies in this situation. It's very
possible that my understanding is flawed and that things are not so
simple, but at the moment I don't see the problem with the above.

The question, then, is "How do I do this, either with SSH or other
software that uses SSH (since SSH is the only way through the
firewalls in question)?"

Thank you,
Greg



Relevant Pages

  • Re: Port Forwarding over Unreliable Connections
    ... >I make extensive use of ssh port forwarding to access machines behind ... >patiently wait a long time before finally snipping the connection. ... two separate TCP connections when you do port forwarding, ...
    (comp.security.ssh)
  • Re: Load estimation - SSH on HP-UX
    ... > perform port forwarding only. ... Run one SSH session per forwarded connection. ... One a single SSH session with a large number of forwarded connections. ... B1) There's a sanity-check limit of the number of port forwards of 100 ...
    (comp.security.ssh)
  • port forwarding source address
    ... The SSH encrypted connection itself can be bound to a specific IP address ... Port forwarding can bind to a specific address on the listening host, ...
    (comp.security.ssh)
  • SSH tunnel and X forwarding
    ... I'm having a problem setting up an SSH connection with X Forwarding in a very special setup, and hope you will be able to help me. ...
    (SSH)
  • Automatically forwarding from sshd server to an application on same box
    ... This client can be setup to use SSH; however, our application does not have kind of SSH encryption built into it at the moment and I'm really trying to avoid that. ... I have been playing around with Putty on a laptop and creating a port forwarding connection from the laptop to a linux box running sshd and our application. ...
    (comp.security.ssh)