Solved

how to create a tcp tunnel with "transparent reconnection"

Posted on 2008-10-05
7
1,224 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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 61

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 61

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

We all know how boring and exhausting it is to transfer huge web projects developed locally to a webserver simply via FTP. The File Transfer Protocol is a really nice solution if you need to transfer small amounts of files, but if you're plannin…
PRTG Network Monitor lets you monitor your bandwidth usage, so you know who is using up your bandwidth, and what they're using it for.
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now