Microsoft KB Archive/812873

= How to reserve a range of ephemeral ports on a computer that is running Windows Server 2003 or Windows 2000 Server =

Article ID: 812873

Article Last Modified on 12/3/2007

-

APPLIES TO


 * Microsoft Windows Server 2003, Standard Edition (32-bit x86)
 * Microsoft Windows Server 2003, Enterprise Edition (32-bit x86)
 * Microsoft Windows Server 2003, Datacenter Edition (32-bit x86)
 * Microsoft Windows Small Business Server 2003 Standard Edition
 * Microsoft Windows Small Business Server 2003 Premium Edition
 * Microsoft Windows 2000 Server
 * Microsoft Windows 2000 Advanced Server
 * Microsoft Windows XP Professional

-



Important This article contains information about how to modify the registry. Make sure to back up the registry before you modify it. Make sure that you know how to restore the registry if a problem occurs. For more information about how to back up, restore, and modify the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows registry



SUMMARY
This article describes how to reserve a range of ephemeral ports on a computer that is running Microsoft Windows Server 2003, Microsoft Windows XP Professional or Microsoft Windows 2000. 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.



MORE INFORMATION
Warning Serious problems might occur if you modify the registry incorrectly by using Registry Editor or by using another method. These problems might require that you reinstall your operating system. Microsoft cannot guarantee that these problems can be solved. Modify the registry at your own risk.

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.

Windows Server 2003 or Windows XP Professional
 Start Registry Editor. 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:

To specify a single port, use the same value for  and. For example, to specify port 4000, type 4000-4000 . Click OK. Quit Registry Editor.</li></ol>

Windows 2000
<ol> Start Registry Editor.</li> Locate and then click the following registry key:

</li> On the Edit menu, click Add Value.</li> In the Value Name box, type ReservedPorts .</li> In the Data Type list, click REG_MULTI_SZ, and then click OK.</li> 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:. To specify a single port, use the same value for  and. For example, to specify port 4000, type 4000-4000 .</li> Click OK.</li> Quit Registry Editor.</li></ol>

Note You must restart the computer after you make these changes for the changes to take effect.

Keywords: kbinfo KB812873

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.