Tunnel to Internal IP's connect to an external IP

Hello, I have a networking question that you guys might have faced and have an answer for it

I have 4 raspberry PI's. One Pi is connected to internet and act as Adhoc, so the other three connect to it and have internet connection.

Here is a picture how the system looks like

Untitled Diagram.drawio

So, If I am connected to the Master through the Wi-Fi, I can just add the port 1880 to any of the slaves and connect node red normally and everything looks fine

Now when the system is away and I need to connect remotely.

I can tunnel to the master PI through one port, so I can tunnel to 22 and still SSH to any slave.
I can tunnel as shown in the picture through local IP and port 5000.

image

First question if I can SSH to the slaves can I access node red some how?

I also was able to tunnel to port 1880, I was able to reach node red of the master successfully! but I can't access the internal IP's

Hello,

I just solved that problem, I will share a quick solution because it's really useful for people that can only SSH to the system which means they have power on only port 22

you need to write that command in the Linux terminal or the windows CMD too and it should work fine

in my case I am tunneling to the raspberry 22 to 5000 on the local ip so 127.0.0.1:5000 to SSH

Now I can redirect the traffic to any port and any IP inside the raspberry PI as follows

My computer ---------> Raspberry PI "IP and port" --------------> My computer

the command Line:

ssh -p 5000 -N -L 3000:192.168.154.10:1880 pi@127.0.0.1
 

in case you are not tunneling, that what you want to forward SSH to port 1880 with any IP in the system

ssh -N -L 3000:IP destination node red installed on:1880 pi@IP you are SSH to it

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.