Training
Module
Configure IP network connectivity - Training
This module explores configuring Windows clients to communicate over IPv4 and IPv6 networks.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This article describes how to reserve a range of ephemeral ports on a computer.
Original KB number: 812873
In some situations, you may want to reserve a range of ports so that a program or process that requests a random port will not be assigned a port that is in the reserved range. When you reserve a range of ports, only a program or process that specifically requests a port that is in the reserved range can use the port.
Important
This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base:
322756 How to back up and restore the registry in Windows
To reserve a range of ports so that only a program or process that specifically requests a port that is in the reserved range can use the port, follow these steps.
Start Registry Editor (Regedit.exe).
Locate and then click the following registry subkey: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
On the Edit menu, point to New, and then click Multi-string Value.
Right-click the new value, click Rename, type ReservedPorts, and then press ENTER.
Double-click the ReservedPorts value, type the range of ports that you want to reserve, and then click OK.
Note
You must type the range of ports in the following format: xxxx-yyyy
To specify a single port, use the same value for x and y. For example, to specify port 4000, type 4000-4000 .
Warning
If you specify the continuous ports separately and if one port is reserved and not used, the next port is not correctly reserved, and it is used.
Click OK.
Quit Registry Editor.
Start Registry Editor (Regedt32.exe).
Locate and then click the following registry key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
On the Edit menu, click Add Value.
In the Value Name box, type ReservedPorts.
In the Data Type list, click REG_MULTI_SZ, and then click OK.
In the Multi-String Editor dialog box, type the range of ports that you want to reserve.
Note
You must type the range of ports in the following format: xxxx-yyyy. To specify a single port, use the same value for x and y. For example, to specify port 4000, type 4000-4000.
Warning
If you specify the continuous ports separately and if one port is reserved and not used, the next port is not correctly reserved, and it is used.
Click OK.
Quit Registry Editor.
Note
You must restart the computer after you make these changes for the changes to take effect.
Windows Vista and later operating systems
Note
the registry setting ReservedPorts are not implemented in Windows Vista, Windows 2008 and later operating systems.
For more information about adjusting the dynamic port range by using the netsh command, click the following article number to view the article in the Microsoft Knowledge Base:
929851 The default dynamic port range for TCP/IP has changed in Windows Vista and in Windows Server 2008
The default dynamic port range for TCP/IP has changed since Windows Vista and in Windows Server 2008
Training
Module
Configure IP network connectivity - Training
This module explores configuring Windows clients to communicate over IPv4 and IPv6 networks.