Tunneling to the private ip from outside network


i want to telnet or ssh my pc (mac) at home from my office. How can i do this ? the problem i'm using router with private ip .Gateway is and my pc is I think i should be able to do this when i forward the port in the router setting. But the problem i don't have public ip. My isp only give my dynamic ip (DHCP) , my router's external ip is just another private ip which is connected to another gateway (another level of LAN) which of course i don't have any access. so is it still possible to get access using telnet to my computer ? i read about the reverse ssh but that only works if i have to setup the connection first from my pc. In my case now there's no body near my pc. i just turn it on so i can hopefully access it.

Is there any workaround ? or it's just impossible to do that ?


Best Solution

As you don't have a stable IP, I can only think of two options:


Were you to make a VPN with your local network, and then connect to said VPN, it would give you access to everything on on the network.

Reverse SSH

With reverse SSH you make use of an external server, and set up a listening ssh session. Then, on the external server you can connect to the device behind the router without being bothered by firewalls/port forwarding/etc...

You could do this with: Device on home network ssh -f -N -R 1234:localhost:22 remote_user@remote.server.example

  • Where 1234 is the port that remote would use forward to the device
  • remote.server.example is the remote's address

Then, on the remote server ssh -p 1234 -t device_user@localhost

Related Question