From: Jamie Lokier <ln@tantalophile.demon.co.uk>
To: "Dr. Michael Weller" <eowmob@exp-math.uni-essen.de>
Cc: linux-kernel@vger.kernel.org, linux-net@vger.kernel.org
Subject: Re: Dynamic TCP reserved ports allocated in which range?
Date: Wed, 25 Apr 2001 14:43:38 +0200 [thread overview]
Message-ID: <20010425144338.B18214@pcep-jamie.cern.ch> (raw)
In-Reply-To: <Pine.A32.3.95.1010419104422.13922A-100000@werner.exp-math.uni-essen.de>
In-Reply-To: <Pine.A32.3.95.1010419104422.13922A-100000@werner.exp-math.uni-essen.de>; from eowmob@exp-math.uni-essen.de on Thu, Apr 19, 2001 at 10:52:00AM +0200
Dr. Michael Weller wrote:
> For a firewall setup I need to know in which range applications like
> rsh, or better yet the rresvport() libc function allocate reserved ports.
>
> Do I have to expect ports in the whole 1..1024 range (maybe omitting those
> already in use by other servers) or is only a limited range used (like
> 512-1023).
This isn't a kernel question as the allocation is handled entirely by
userspace. Userspace tries each port in turn until it finds one that
isn't used at the moment.
The non-privileged local port range can be read from and written to
/proc/sys/net/ipv4/ip_local_port_range, but that's not your question.
The man page for rresvport() says:
The rresvport() function is used to obtain a socket with a
privileged address bound to it. This socket is suitable for use by
rcmd() and several other functions. Privileged Internet ports are
those in the range 0 to 1023. Only the super-user is allowed to
bind an address of this sort to a socket.
For a firewall, you should probably distinguish these ports from fixed
services ports (like ssh and smtp) by having different rules for
Outgoing and Incoming connections. This is done by matching on the TCP
SYN and ACK flags (see any firewall tutorial).
enjoy,
-- Jamie
prev parent reply other threads:[~2001-04-25 12:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-04-19 8:52 Dr. Michael Weller
2001-04-25 12:43 ` Jamie Lokier [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20010425144338.B18214@pcep-jamie.cern.ch \
--to=ln@tantalophile.demon.co.uk \
--cc=eowmob@exp-math.uni-essen.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-net@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®