Port redirecting is necessary when you want to use an invisible service for your IP address.
For example: The license server krankenschwester.icm.edu.pl on the port 1705 is the software license server. Access to the license is granted only to the computer Tezro.wcss.pl. The user wants to use the license on his home computer. For this purpose he should create a tunnel between the home computer and the license server via the computer Tezro. The tunnel will make the access from the home machine will be seen on the license server as access from the authorized machine Tezro.
Creating a tunnel will open port 1705 ((the number chosen by the user) on the user's home computer. The user then gives the local address of his home computer and the port opened as the address of the server license - 127.0.0.1:1705 - it will be seen by the license server as access to port 1705 from the machine Tezro.
To redirect port (or ports) under Windows you will need a program Putty.
When you start the program, you will need to specify the server address (or IP address) through which the tunnel (the Tezro computer from the example) in the "Host Name" field.
# Port redirection
Next select tunnels
from the left menu the items Connection->Ssh
The local port number (1705 port from the example) must be entered in the field of the destination server with the port number after the colon to which the tunnel is to reach (Licence Server and 1705 port by example) and in the field of the destination server.
After clicking on the Open button and login to the system (Tezro computer by example) the tunnel will be created. The application as the address of the license server should be given
To redirect the port under Linux, use ssh, with the option -L. This option is used as a string parameter in the form of a -L local_port:remote_address:remote_ports
, e.g.
ssh -L 1705:krankenschwester.icm.edu.pl:1705 tezro.wcss.wroc.pl
Such a command will result in connection with the computer tezro.wcss.wroc.pl, opening on the local machine port 1705 to which access will result in connection with the server krankenschwester.icm.edu.pl on port 1750 with the source address tezro.wcss.wroc.pl.