SUPPORT / SAMPLES & SAS NOTES
 

Support

Usage Note 43946: Ephemeral port range

DetailsAboutRate It

Ephemeral Ports

Ephemeral ports are temporary ports that are assigned by a machine's IP stack from a designated range of ports that are specifically for temporary use. When you terminate a connection to an ephemeral port, that port is available for reuse. However, most IP stacks do not reuse that port number until the entire pool of ephemeral ports have been used. So, if the client program reconnects, it is assigned a different ephemeral port number for its side of the new connection.

The following sections provide system-specific information about ephemeral ports.

IBM AIX Operating Environment

AIX uses the no command to set network options. AIX uses two separate ephemeral port ranges, one for transmission control protocol (TCP) and one for user datagram protocol (UDP). Both of these ports default to values that range from 32768 through 65535.

Under AIX, you query the ephemeral port range as follows:

# /usr/sbin/no -a | fgrep ephemeral
To change these range values, use the -o option, as follows:
# /usr/sbin/no -o tcp_ephemeral_low=49152 -o tcp_ephemeral_high=65535

If you want to make this change permanent, insert your no commands in /etc/rc.tcpip. Add the commands at a location before the script starts the server daemons.

Linux Operating Environment

The Linux port range is in the ip_local_port_range file that is found in /proc/sys/net/ipv4/. To change the range, simply edit the file. Be aware that a range change that is made in this file is not permanent; the change reverts back the next time you start the system. To make the change permanent, add the following line to /etc/rc.local:

# echo "49152 65535" >/proc/sys/net/ipv4/ip_local_port_range

Sun Solaris Operating Environment

Solaris uses the ndd utility program to configure the IP stack. Solaris uses two separate ephemeral port ranges, one for TCP and UDP. Both ports default to values from 32768 through 65535.

The following examples illustrate how you can query and change the settings:

Example 1: Query the Current Settings

# /usr/sbin/ndd /dev/tcp tcp_smallest_anon_port tcp_largest_anon_port 32768 65535

Example 2: Change the Settings

# # /usr/sbin/ndd -set /dev/tcp tcp_smallest_anon_port 49152 # /usr/sbin/ndd -set /dev/tcp tcp_largest_anon_port 61000 # /usr/sbin/ndd /dev/tcp tcp_smallest_anon_port tcp_largest_anon_port 49152 61000 #

These changes last until the next time you start your system.

Hewlett-Packard HP-UX Operating Environment

HP-UX also uses ndd to configure the IP stack, but it is found in the /usr/bin directory (/usr/bin/ndd). HP-UX uses two separate ephemeral port ranges, one for TCP and UDP. Both of these ports default to values from 49152 through 65535. You query and change the setting under HP-UX the same as is shown for Solaris in the previous section.

As is the case with Solaris, any changes under HP-UX last only until the next time you start your system.

Microsoft Windows Operating Environment

Windows Server 2008 and later use a default range of values from 49152 through 65535. For details about how to change a range under Windows, see the Microsoft knowledge-base article 929851, "The default dynamic port range for TCP/IP has changed in Windows Vista and Windows Server 2008."

Earlier releases of Windows use a default range of values from 1024 through 4999. For details about these earlier releases, see the Microsoft knowledge-base article 196271, "When you try to connect from TCP ports greater than 5000, you receive the error 'WSAENOBUFS (10055).'



Operating System and Release Information

Product FamilyProductSystemSAS Release
ReportedFixed*
SAS SystemN/AMicrosoft Windows 2000 Professional
Microsoft® Windows® for 64-Bit Itanium-based Systems
Microsoft Windows Server 2003 Datacenter 64-bit Edition
Microsoft Windows Server 2003 Enterprise 64-bit Edition
Microsoft Windows XP 64-bit Edition
Microsoft® Windows® for x64
Microsoft Windows 2000 Advanced Server
Microsoft Windows 2000 Datacenter Server
Microsoft Windows 2000 Server
Microsoft Windows Server 2003 Datacenter Edition
Microsoft Windows Server 2003 Enterprise Edition
Microsoft Windows Server 2003 Standard Edition
Microsoft Windows Server 2003 for x64
Microsoft Windows Server 2008
Microsoft Windows Server 2008 for x64
Microsoft Windows XP Professional
Windows 7 Enterprise 32 bit
Windows 7 Enterprise x64
Windows 7 Home Premium 32 bit
Windows 7 Home Premium x64
Windows 7 Professional 32 bit
Windows 7 Professional x64
Windows 7 Ultimate 32 bit
Windows 7 Ultimate x64
64-bit Enabled AIX
64-bit Enabled HP-UX
64-bit Enabled Solaris
ABI+ for Intel Architecture
AIX
HP-UX
HP-UX IPF
IRIX
Linux
Linux for x64
Linux on Itanium
OpenVMS Alpha
OpenVMS on HP Integrity
Solaris
Solaris for x64
Tru64 UNIX
* For software releases that are not yet generally available, the Fixed Release is the software release in which the problem is planned to be fixed.