Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

tunneling to my private ip from outside network [closed]

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 192.168.1.1 and my pc is 192.168.1.100. 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 ?

Thanks

like image 774
andio Avatar asked Feb 17 '23 08:02

andio


1 Answers

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

VPN

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 [email protected]

  • 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

like image 188
demure Avatar answered Mar 03 '23 19:03

demure