aboutsummaryrefslogtreecommitdiff
path: root/doc/forwarding.dox
blob: f6a2869ef5aac27a9a037c4a14e493e22059a36b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/**
@page forwarding Chapter 7: Forwarding connections
@section forwarding_connections Forwarding connections

Port forwarding comes in SSH protocol in two different flavours:
direct or reverse port forwarding. Direct port forwarding is also
named local port forwardind, and reverse port forwarding is also called
remote port forwarding.



@subsection forwarding_direct Direct port forwarding

Direct port forwarding is from client to server. The client opens a tunnel,
and forwards whatever data to the server. Then, the server connects to an
end point. The end point can reside on another machine or on the SSH
server itself.

Example of use of direct port forwarding:
@verbatim
Mail client application   Google Mail
         |                    ^
     5555 (arbitrary)         |
         |                143 (IMAP2)
         V                    |
    SSH client   =====>   SSH server 

Legend:
--P-->: port connexion through port P
=====>: SSH tunnel
@endverbatim
A mail client connects to port 5555 of a client. An encrypted tunnel is
established to the server. The server connects to port 143 of Google Mail (the
end point). Now the local mail client can retreive mail.


@subsection forwarding_reverse Reverse port forwarding

The reverse forwarding is slightly different. It goes from server to client,
even though the client has the initiative of establishing the tunnel.
Once the tunnel is established, the server will listen on a port. Whenever
a connection to this port is made, the server forwards the data to the client.

Example of use of reverse port forwarding:
@verbatim
 Local mail server    Mail client application
         ^                     |
         |               5555 (arbitrary)
     143 (IMAP2)               |
         |                     V
    SSH client   <=====   SSH server

Legend:
--P-->: port connexion through port P
=====>: SSH tunnel
@endverbatim
In this example, the SSH client establishes the tunnel,
but it is used to forward the connections established at
the server to the client.

*** To be written ***

*/