tunneling

In this example we would like to reach the GUI of a router which is not in our LAN and it’s management IP is not routed through the network.

First we create a tunnel between our Laptop and Server1:
step1

step2

We open this session, login to Server1 (the tunnel is built) and start building the second tunnel:

ssh -L 50112:192.168.0.1:80 username@172.0.0.1

After login the connection is ready.

Now all communication on the Laptop which is destined to 127.0.0.1:50111 will be sent to port 80 of the Router.