Default ephemeral port range
Dustin Wenz
dustinwenz at ebureau.com
Wed Nov 14 17:53:28 UTC 2012
On Nov 14, 2012, at 12:23 AM, Fernando Gont <fernando at gont.com.ar> wrote:
> On 11/12/2012 02:57 PM, Dustin Wenz wrote:
>> I'm trying to determine why the default ephemeral port range appears
>> to be 10000 through 65535 in at least 8.1 through 9.1RC.
>
> I had produced the patch that extended the ephemeral port range in
> FreeBSD. My original patch extended the ephemeral port range to
> 1024-65535. However, it was noted that X uses ports in the range
> 1024-10000, and hence it was better to exclude that port range from the
> ephemeral port range.
>
>
>> The IANA recommends the range be 49152 through 65535
>> (http://tools.ietf.org/html/rfc6056).
>
> IANA *used* to recommend that range. In RFC 6056 we recommend
> implementations to use the largest possible port range -- ideally
> 1024-65536.
>
Ah; that clarifies things quite a bit. There seems to be a lot of incorrect/outdated information online about this.
The suggestion from Eugene is also useful. I should be able to use setsockopt() with IP_PORTRANGE_HIGH if I cared to use the high range only. I probably don't want to do that in most cases, but it's good to understand what the differences are.
Thanks for the help!
- .Dustin
More information about the freebsd-net
mailing list