Hello Friends! Previously we have discussed on SSH tunnel and step to perform dynamic tunneling (port forwarding) which you can read from here. Today we will talk on same scenario and perform local tunneling (port forwarding).
Local tunneling is a process to access a specific SSH client machine for communication. It let you establish the connection on a specific machine which is not connected from internet.
The only difference between dynamic tunneling and local tunneling is that, dynamic tunneling requires socks proxy for tunneling all TCP traffic and local tunneling only required destination IP address.
Objective: To establish SSH connection between remote PC and local system of different network.
Here I have set my own lab which consist three systems in following network:
- SSH server(two Ethernet interface)
- IP 192.168.1.217 connected to remote system 192.168.1.219
- IP 192.168.10.2 connected to local network system 192.168.10.2
- SSH client(local network) holds IP 192.168.10.2
- Remote system(outside network) holds IP 192.168.1.219
Given image below is describing the network configuration for SSH server where it is showing two IP 192.168.1.217 and another 192.168.10.1 as explain above.
Another image given below is describing network configuration for SSH client which is showing IP 192.168.10.2
Remote Pc (192.168.1.219) is trying to connect to SSH server (192.168.1.217) via port 22 and get successful login inside server.
Similarly now Remote PC (192.168.1.219) trying to connect with Client PC (192.168.10.2) via port 22, since they belongs to different network therefore he receive network error.
Step for SSH Local tunneling
- Use putty to connect SSH server (192.168.1.22) via port 22 and choose option SSH >Tunnel given in the left column of category.
- Give new port forwarded as 7000 and connection type as local
- Destination address as 184.108.40.206:22 for establishing connection with specific client and click on ADD at last.
- Click on open when all things are set.
This will establish connection between remote pc and SSH server.
Open new window of putty and follow given below step:
- Give hostname as localhost and port 7000 and connection type SSH.
- Click on open to establish connection.
Awesome!! We have successfully access SSH client via port 7000
Author: AArti Singh is a Researcher and Technical Writer at Hacking Articles an Information Security Consultant Social Media Lover and Gadgets. Contact here