I need to control many several Linux devices behind a NAT.
So I was thinking of embedding a script to tunnel ssh to my server. Thinking this might be expensive for the server.
Though how do I allocate it a port to tunnel to? I can not statically fix a port to each image I create for the machines, since the same image is used to image 100+ devices.
The best way to identify the machines in question is by MAC address. Maybe a hash of the mac address somehow mapped to ports 1000-5000? Any bright ideas?
I need to be able to say port 2045 is very likely to be f0:de:f1:a1:dd:f0 or something like that.