[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FW: VPN using SSH and VTun



On Wed, 2002-01-02 at 16:29, Martinez Cpl Andres H wrote:
> Hi Folks,
> 
> Thanks for all your replies on- and off-line about setting up a VPN with
> SSH. In the end, I decided to use PPP instead of VTun, and it's working to a
> point. The problem that I'm having now is that the SSH connection keeps
> dropping off after a while (not sure how long, it tends to stay up as long
> as I keep a terminal open pinging across the connection, but otherwise it
> it's gone after an hour or so.)
> 
> I stuck with essentially the same IP configuration that I diagrammed in my
> last message, except that the NATing is taking place on the work machine,
> and I'm using 10.0.0.1 <-> 10.0.0.2 for the PPP link.
> 
> from the work machine, I'm initiating SSH with teh following command line:
> 
> # ssh -f -C -p 443 -R 5000:localhost:5000 aaa.bbb.ccc.ddd "ping 10.0.0.1"
> 
> then I start the PPP connection from the home machine with the following
> command:
> 
> # ppp -ddial vpppn
> 
> for a while I'll see the ssh/sshd process on both machines, and the ping
> process on the home machine, but after a while the connection will
> apparently drop, and I'll start getting errors from ppp as it tries to bring
> the link back up.
> 
> My question, I suppose, is whether there is a way to script sshd to restart
> automatically when it dies:
> 
> 	while(true)
> 		ssh <args>;
> 
> I know this is a pretty basic question, but any answers would be
> appreciated.
this is weird. It also happens with my work's firewall. Because after a
while & since there is no packet exchange between the two boxes, the
connection is kicked off the firewall's state table & bang ! the
connection goes down. Maybe you can code a small stuff in perl that will
send a keep alive packet (open socket, send stuff, ack, close socket) in
a timely fashion ?

-- 
/Saad --  [bsdguy@docisland.org] 
[pgp keyid: 35592A6D http://pgp.mit.edu]
# buy a geek-in-a-can, point nozzle at technical problem and spray
# if desesperate degauss your screen. it might solve your pb as well