Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

closed as not a real question by voretaq7 Aug 25 '12 at 5:35

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

It's not entirely clear what you are asking for but would something like the solutions listed here help serverfault.com/questions/2533/… –  Iain Feb 5 '12 at 9:15
I also don't understand your question at all -- what does a botnet have to do with that? Where do you want to embed the tunneling script into? What do you mean by "expensive for the server" (a single tunnel would not be expensive either in terms of bandwidth or CPU load), and what do you mean by "statically fixing a port"? Finally, you need to elaborate why you can't address your target machines by anything but the MAC address -- don't they have DNS names or static IP addresses? –  jstarek Feb 5 '12 at 12:08
The title of this question is suggestive at best but the content of the question is not very clear. You should change the question to be more consisely describe your problem in more detail. –  Matthew Ife Feb 5 '12 at 14:27

1 Answer 1

It's not clear what you're asking, but for the "connect to boxes behind a NAT" scenario, it's probably better to set up a simple VPN. OpenVPN should be fine for this, and is available as a package for most linux distros.

So, set up an OpenVPN server. On the machines behind the NAT, set up OpenVPN client to connect to that server. The server will assign IP addresses on a separate tun0 interface for each client, say, in the 10.10.10.x network (or whatever you want, to avoid collisions with the LAN for the clients). You can then ssh to each of these machines from the server, on that 10.10.10.x IP.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.