Re: ephemeral ports

From: Shawn Bayern (shawn.bayern@yale.edu)
Date: Thu Mar 30 2000 - 21:23:18 EST


On Thu, 30 Mar 2000, David Barcelo wrote:

> is there any way to specify restrictions on which ephermeral ports to use?

Yes. Write to /proc/sys/net/ipv4/ip_local_port_range in the same format
in which it appears when you read it (i.e., starting port, tab, ending
port, all as text strings representing numbers).

You can also bind your outgoing connection to a specific port with bind(),
although it's generally better to let the system assign one itself. (How
often do you see bind() in a client, except for the stuff we talked about
earlier on this list regarding choosing the source address in an IP
packet.)

Interestingly enough, I'd never heard the term "ephemeral port," but I
guess it's cool because as soon as I thought about it, it's clear what it
means.

Shawn



This archive was generated by hypermail 2b29 : Wed Apr 27 2005 - 03:30:03 EDT