Reserving localhost port numbers

FreeBSD Questioner freebsd-questions at
Tue Dec 2 19:51:04 UTC 2014


This question is regarding a networking scheme, utilizing multiple remote sensor systems in the field, which connect to a central freebsd server via ssh.

When making these connections, the remote field systems "reverse tunnel" certain listening ports to the server via the ssh -R parameter.

Since there are multiple field systems, each one has a unique offset to which to map it's listening ports, when tunneling them to the central server. This prevents multiple field systems from attempting to listen on the same port number on the central server.

My question involves these listening port numbers on the central freebsd server: 

Is there a way to reserve a block of port numbers, preventing them from being used as "ephemeral" ports, by other network traffic on the central server?

It would be desirable to reserve a block of 10000 or so ports, anywhere above the 1024 "privileged port" range.

Thank you for any suggestions or references that may shed light on managing the networking stack's allocation of localhost port numbers.

More information about the freebsd-questions mailing list