One way would be to use port forwarding, so that distant clients do not try to directly access the zeros, but target a specific port on the central pi which then passes the traffic on. You need something likeThe 1234 will be the port on the pi, and will need to be different for each connected zero. The 192.2.3.4:5678 will be the zero address and port. Obviously there, the address will change for each zero, but if you are running the same software on each then the port will probably stay the same.
Once you have it working you need to make it survive a reboot. It is a while since I did this, but I think you need the iptable-save command from the iptables-persistent package.
Code:
sudo iptables -t nat -A PREROUTING -p tcp --dport 1234 -j DNAT --to-destination 192.2.3.4:5678
Once you have it working you need to make it survive a reboot. It is a while since I did this, but I think you need the iptable-save command from the iptables-persistent package.
Statistics: Posted by IanS — Thu Dec 05, 2024 5:36 pm