Re: PPTP or PPP over SSH?



On 2006-02-23, r_vanbeek@xxxxxxxxxxx <r_vanbeek@xxxxxxxxxxx> wrote:

Anonymous wrote:
Suggested reading. "Why TCP Over TCP Is A Bad Idea" by Olaf Titz.
http://sites.inka.de/sites/bigred/devel/tcp-tcp.html

Actually that should be "Why TCP over IP over TCP..." (more on why later).

You could probably mitigate some of the potential problems by configuring
the SSH connection to be sensitive to network failures (eg by setting
ClientAliveInterval to a couple of seconds and ClientAliveIntervalMax to 1
or 2).

In theory this would cause it to look more like a "lossy" link to the
upper TCP during brief network problems or congestion. It's probably
unusable on links with consistently high packet loss, though.

I already read that, but it did not help me in selecting (another)
right protocol.

Can you SOCKSify your app (either directly, via LD_PRELOAD or via the
system's stack itself)? If so then you could use DynamicForwards.

[now it gets weird]

On a slightly related note, here's a neat hack from the I'm
amazed-that-it-works dept (absolutely not a production-quality solution,
though :-)

You can stack pppd, slirp (anyone remember slirp?) and SSH dynamic (SOCKS)
forwarding. It sounds insane but I just tried it and it works for TCP
connections: you can transparently tunnel them over SSH as direct-tcpip
channel requests.

For those that aren't familiar with it, slirp is a Unix app that looks
like a SLIP or PPP interface on one side but a regular(ish) Unix network
application on the other. It basically implements a little TCP/IP
stack and reassembles TCP connections (and UDP packets) then makes the
equivalent connect/bind/whatever calls on the Unix host. It was used
quite a bit back in the dark days before dialup SLIP/PPP services were
common.

Anyway, I built a socksified slirp binary (using dante socks), ran it
under pppd, configured socks.conf to send socksified connections via an
ssh DynamicForward and added a route to ppp0.

Amazingly, this kinda worked. Making a connection to something down
that route results in:

app -TCP/IP-> ppp0 -> slirp -SOCKS-> ssh -tunnel-> sshd -> TCP -> server

The TCP connections travel over the SSH tunnel as port forward requests
and without the extra IP layer that may cause the problems described.
UDP services don't work, though.

In case anyone else is nutty enough to try this, the recipe I used is:

ssh: ssh -D1080 somehost
dante: standard install, configured to forward via localhost:1080
slirp: CFLAGS="-include socks.h" LIBS="-ldsocks" ./configure
pppd: /usr/sbin/pppd debug nodetach pty "slirp -P"

--
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69
Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.
.



Relevant Pages

  • Re: Looking for program that emails me when dhcp addr changes
    ... For SSH all you need forwarded is TCP Port 22... ... >>participate in TCP connections or UDP conversations it initiates but ...
    (comp.security.ssh)
  • ssh v4.2p1 IPv6 TCP checksum error
    ... repeatedly encounter TCP checksum errors. ... on to the ssh problem... ... Internet Protocol Version 6 ... Transmission Control Protocol, Src Port: 41335, Dst Port: ssh ...
    (SSH)
  • Re: ipfw and nmap
    ... > even be correct but I have a bsd box that is simply providing me SSH ... add allow tcp from any to me 22 setup in via fxp0 keep-state ... Note too that there is nothing to prevent port scanners simply setting ... the 'SYN' flag in the probe packets they send to your server. ...
    (freebsd-questions)
  • RE: SUMMARY:RE: TCP_keepalive
    ... of short and unreliable connections). ... creating a TCP socket. ... printf "Decrease the tcp time wait interval\n" ...
    (SunManagers)
  • Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+
    ... is discovered to see if TCP still tries to do something, ... use -v or -vv for full protocol decode ... Active Internet connections ... # ISDN4Linux hardware drivers ...
    (Linux-Kernel)