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)
  • Re: Using an IP from remote server on home computer
    ... > connection. ... > ports (does not require root access on remote server). ... > tried ssh port forwarding with a Windows ssh client like Putty. ...
    (comp.os.linux.networking)
  • Tunneling SMTP Traffic Via SSH Question
    ... forward port 25 over SSH via Putty to an off-campus mail server. ... Tunnels> Forwarded ports: ... When I try testing the connection in Outlook it returns an error saying ... I could get around that via SSH forwarding. ...
    (Security-Basics)