How do I reserve ports on Windows?

Document ID : KB000025869
Last Modified Date : 14/02/2018
Show Technical Document Details

Question: 

In certain cases ports needed by an application to function are dynamically allocated to other applications which causes the application not to function. Is there a way to reserve these ports such that they are not dynamically allocated?

 

Environment:  

CA Client Automation 12.0, 12.0 SP1, 12.5, 12.5 SP1, 12.8, 12.8 FP1, 12.9

 

Answer: 

'netstat -b' lists the ports which are being used by applications.

To reserve a specific port, add the port number to the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\ReservedPorts

Ex: If port 4728 has to be reserved then add 4728-4728 to the registry key:

467379a.gif

 

Refer the following URL for more information: http://support.microsoft.com/kb/812873

 

IMPORTANT: This article contains information about modifying the registry.
Before you modify the registry, make sure to create a backup of the registry and ensure that you understand how to restore the registry if a problem may occur
For more information about how to backup, restore, edit the registry, please review the relevant Microsoft Knowledge Base articles on support.microsoft.com.