Solved

how to create a tcp tunnel with "transparent reconnection"

Posted on 2008-10-05
7
1,236 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Report: Liquid Web beats Amazon, Rackspace & More

A study by performance analyst firm Cloud Spectator finds that Liquid Web beats rivals Amazon, Rackspace and DigitalOcean when it comes to website and cloud application performance.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
mlppp with hsrp tracking? 2 26
Recommendation for open source Monitoring 7 96
Can i use a GC as a DC? 7 73
line utilization 4 24
#Citrix #Citrix Netscaler #HTTP Compression #Load Balance
In this article, I am going to show you how to simulate a multi-site Lab environment on a single Hyper-V host. I use this method successfully in my own lab to simulate three fully routed global AD Sites on a Windows 10 Hyper-V host.
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…
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…

737 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