Port Forwarding in Linux

Consider a scenario where there is a Web application running in a Linux machine (which is in a private network), which is accessible only from a proxy server.

Now to access the web application running in a particular port in that private machine, we need to forward the port to our Local machine. This is known as Port forwarding. This can be achieved using a putty client.

You need the following details before setting up port forwarding.
1. Proxy server IP & credentials (16.10.1.1, serverP/serverP)
2. Private Server IP (192.10.5.2)
3. Port in which the web application is running (8080)
4. Port in which you want the web application to be available in your local system (8080)

Steps to be followed are,

1. Install Putty client by downloading it from internet.

2. Run the downloaded file -> Putty Configuration window -> Enter host name (serverP@16.10.1.1), Select SSH radio button -> Go to Connection -> SSH -> Tunnels in the Category panel (right hand side) -> Enter the source port(8080) and destination port(192.10.5.2:8080) -> Click open -> SSH client window will be opened -> Enter the password -> You will be logged on.

3. Now, the Linux server port can be accessed as local port (PC or laptop). It can be verified by the navigating to the URL in browser http://localhost:8080/

In this way, Port forwarding can be done.

Search