Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to set my port forwarding routes far far away from the normal ports which my computer uses. I asked this question on Google and nothing like it came up, so, here I am.

(this is a subjective question I know just shoot)

share|improve this question

closed as not constructive by Sven, Zoredache, Jacob, Tom O'Connor, Khaled May 18 '12 at 12:11

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 5 down vote accepted

You should take a look at nmap's nmap-services file (contained in the sources). A line will be like this:

# Service name, portnum/protocol, open-frequency, optional comments
tcpmux  1/tcp   0.001995        # TCP Port Service Multiplexer [rfc-1078]

This way, you can look at ports non-dedicated to well-known services, which are specified as 'Service name = unknown'. The list is quite extensive:

petrus:~/nmap-6.25$ grep unknown nmap-services | wc -l

Also, another very interesting field in the nmap-services is the open-frequency number. Pick the port which has the lowest number for your needs.

This has nothing to do with the operating system, as the file is just plaintext. You can grab the file in the sources or on nmap's web svn.

Here are the 10 least-used ports according to the nmap-services file:

petrus:~/nmap-6.25$ grep unknown nmap-services | awk -F" " '{print $3 " " $2}' | sort | head
0.000013 226/tcp
0.000013 228/tcp
0.000013 229/tcp
0.000013 234/tcp
0.000013 238/tcp
0.000013 270/tcp
0.000013 271/tcp
0.000013 277/tcp
0.000013 288/tcp
0.000013 289/tcp
share|improve this answer
Does this work on windows? Forgive me but my mac is in the shop. – boulder_ruby May 17 '12 at 22:10
@David: of course. See my edit. – petrus May 17 '12 at 22:43

There's a sister question to this on Security.SE: Are some uncommon TCP ports scanned less than others?

Among other things in my answer, you'll find from the registered port list there (or in SpacemanSpiff's answer) that... the range 49152–65535 - above the registered ports - contains dynamic or private ports that cannot be registered with IANA

share|improve this answer
Just saw your answer, and I didn't knew that this answer existed on security.SE... – petrus May 17 '12 at 21:49

There are only ~65k ports available. The first thousand or so are considered "well known". Usage over this is fairly random. Just pick something you can remember with 5 digits. You are STILL going to get port scanned, so be sure whatever you forward to is locked down.

EDIT: This will help you

share|improve this answer

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