Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

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

Is it possible to narrow the allowed range of outbound ports that can be used for a specific protocol (e.g. HTTP(S))? I understand that, by default, the system will randomly allocate any available port but is that configurable to use a specific one?

share|improve this question
use mangle table of 'iptables'.With mangle you can doing traffic shaping. – PersianGulf Mar 22 '13 at 22:23

No, it makes little sense anyway. Why do you want to do this?

share|improve this answer
to get a controllable handle on the network interface -- within some ranges. E.g. if i wanted some protocol to stay away from some port segments. – amphibient Mar 23 '13 at 0:48
This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. – rahmu Mar 23 '13 at 1:04
@rahmu The question was "is it possible"; it's not automatically an invalid answer just because it has a question mark in it – Michael Mrozek Mar 23 '13 at 19:25
It's not about the question mark. It's about the request for clarification. It's clearly stated in the auto-comment, I didn't invent it. Thank you for assuming I do these review tasks mechanically without putting thoughts into it. Highly appreciated. – rahmu Mar 23 '13 at 19:51
@vonbrand: I still think the answer is very poorly worded. It should have more explanations. What makes you say that it's a "No" without doubt, as opposed to a "I don't know how to do it"? – rahmu Mar 23 '13 at 19:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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