Reserve a TCP port in Windows

后端 未结 5 1721
小鲜肉
小鲜肉 2021-02-01 23:14

I\'d like to reserve a TCP port, to be bound by a service later, so that Windows doesn\'t inadvertently use the same number when assigning random port numbers. I know this is po

5条回答
  •  逝去的感伤
    2021-02-01 23:47

    Edit: This only applies to pre-Windows Server 2008 (Microsoft Support KB)

    You can edit the 'ReservedPorts' Registry Setting in

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters

    To reserve a range of ports follow the format '4000-4010' or 'xxxx-yyyy' however to reserve a single port you have to use the format of '4000-4000' or 'xxxx-xxxx'

    http://support.microsoft.com/kb/812873

提交回复
热议问题