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
Solved

how to create a tcp tunnel with "transparent reconnection"

Posted on 2008-10-05
7
1,233 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
  • 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
Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

 
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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
android secure ftp 3 50
Wireless scope on sever with DSL connection 9 35
How to Link NetGear wireless AC-1200 router to Sonicwall 3600 13 60
Changing password for HP switch 5 37
Don’t let your business fall victim to the coming apocalypse – use our Survival Guide for the Fax Apocalypse to identify the risks and signs of zombie fax activities at your business.
Data center, now-a-days, is referred as the home of all the advanced technologies. In-fact, most of the businesses are now establishing their entire organizational structure around the IT capabilities.
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
Viewers will learn how to properly install and use Secure Shell (SSH) to work on projects or homework remotely. Download Secure Shell: Follow basic installation instructions: Open Secure Shell and use "Quick Connect" to enter credentials includi…

839 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