Wednesday, March 9, 2011

Setting up VNC port Forwarding :

Scenario :
LAN is in the Ranage 172.x.x.x

Host1 IP (172.x.x.1/192.x.x.1)
Host2 IP (192.x.x.2)

Windows Desktop : 172.x.x.32


I want to connect to Host2 using VNC connection but Host2 is in 192 series network while
my desktop is in 172 series.

Here to be able to do that I do port forwarding from Host1 to Host2's VNC port.

Host1 which has172 and 192 series and I am able to connect from desktop to its 172 series network.

Steps:
1) Login to  Host1
ssh -L 5901:Host2:5901 root@host2


ssh -L LocalPort:ServiceHost:ServicePort SSHID@SSHHost

Where:

  • LocalPort is a local TCP port
  • ServiceHost is a remote host that provide the target service, such as email, VNC, etc
  • ServicePort is a listening port of the target service at ServiceHost, i.e. 110 for POP3 email
  • SSHID is a SSH login ID to the SSH server that can be connected to establish a secure / encrypted SSH tunnel
  • SSHHost is the remote host that running the SSH server


Now if you try connecting from windows desktop to Host1's VNC port on 5901 it will connect you to
Host2's VNC port.


No comments:

Post a Comment