Solved

how to create a tcp tunnel with "transparent reconnection"

Posted on 2008-10-05
7
1,235 Views
Last Modified: 2013-12-23
ssh -f -N -L 2222:myremotemachine.com:3333 myremotemachine.com
Specifies that port 2222 on the local (client) host is to be forwarded to myremotemachine.com:3333.
This works by allocating a socket to listen to port 2222 on the local side. Whenever a connection is made to this port, the connection is forwarded over the secure channel, and a connection is made to myremotemachine.com:3333 from myremotemachine.com.

This works pretty well.

However, my client machine is inside a firewall that closes all connections after two hours. This is a hard constraint and it cannot be changed, and sending keep alive messages or anything else does not help.


the question is:
is there an equivalent to this: ssh -f -N -L 2222:myremotemachine.com:3333 myremotemachine.com
with the option of "transparently reconnecting" whenever the tunnel connection is broken?

by "transparently reconnecting" I mean that when the tunnel connection is broken,
the connection of the local application to localhost:2222 is not closed, nor is the connection from myremotemachine.com to myremotemachine.com:3333,
so that the application does not even notice that the tunnel connection was broken.

ps: is this a standard feature? does it have a proper name?
pss: i would prefer to install a standalone light software to both machine for this,
instead of complex and heavy solutions as installing a real vpn.
psss: one computer is running osx and the other is running mswindows with cygwin and open ssh server.

Regards,
DAvid
0
Comment
Question by:dportabella
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 13

Expert Comment

by:Rowley
ID: 22648562
Take a look at http://www.harding.motd.ca/autossh/ or http://sourceforge.net/projects/rstunnel/ . I imagine using either of these solutions, you are trusting the application to retransmit unless its UDP based.

To get some kind of transparency, you'd need the connection to be handled at the IP layer, separate from the application itself. Something like a VPN.

hth.
0
 

Author Comment

by:dportabella
ID: 22648953
autossh and rstunnel are not useful in this case.
that is, if the tunnel connection is broken (even if the tunnel will reconnect),
the connection from the local application to localhost:2222 will be closed. (and the connection from myremotemachine.com to myremotemachine.com:3333 will also be closed).


>To get some kind of transparency, you'd need the connection to be handled at the IP layer,
Yes, in the general case.
However, I do not agree with your conclusion for the concrete case I am talking about.


Regards,
DAvid
0
 
LVL 13

Expert Comment

by:Rowley
ID: 22649168
Disagree all you like, I think you're asking for something that isn't possible the way you want it. I hope for your sake I'm proved incorrect. I'll watch this space...
0
Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

 
LVL 62

Expert Comment

by:gheist
ID: 22652951
You can tunnel (ppp or tcp) over http like htc/hts does on Linux.
OpenVPN and most other IPSEC VPN's can be made to "redial" on disconnect
0
 

Author Comment

by:dportabella
ID: 22653747
gheist,
htc/hts creates a tunnel, in the same way as the ssh example, through http instead of ssh.
ssh -f -N -L 2222:myremotemachine.com:3333 myremotemachine.com

that's ok.
however, the problem is still the same:
if the http tunnel connection is broken (even if the tunnel will reconnect),
the connection from the local application to localhost:2222 will be closed. (and the connection from myremotemachine.com to myremotemachine.com:3333 will also be closed).


What I am asking is a software that when the tunnel connection is broken,
the connection of the local application to localhost:2222 is not closed, nor is the connection from myremotemachine.com to myremotemachine.com:3333,
so that the application does not even notice that the tunnel connection was broken.


Regards,
DAvid
0
 
LVL 62

Accepted Solution

by:
gheist earned 500 total points
ID: 22656795
htc/hts uses many short connections containing obscure http requests over short http connections that together makes uninterrupted (but somewhat higher latency) tcp or ppp tunnel.
0
 

Author Comment

by:dportabella
ID: 22709434
hello gheist,

you are right, htc/hts seems a very good solution for my task,
without the need of handling the connection at the IP layer.

Thanks,
DAvid
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
Most of the applications these days are on Cloud. Cloud is ubiquitous with many service providers in the market. Since it has many benefits such as cost reduction, software updates, remote access, disaster recovery and much more.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question