1

(I originally posted a similar question on StackOverflow but readers recommended I post here instead)

When you create outgoing TCP connections, most applications let the operating system choose which port to use. Most OSes use the IANA recommended dynamic port range of 49152-65535 for this purpose. But in Windows 2003 and earlier (including XP) Microsoft uses ports 1025-5000. Microsoft lets you change the high end of this range via the MaxUserPort TcpIP registry setting, but I see no way to change the low end. I need to have port 4160 free for incoming connections and on rare occasions an outgoing connection steals that port from me before I bind that port.

1
  • I am not aware of any way to get around this. Upgrade to vista/2003 or higher (which has a less broken TCP/IP stack), or avoid using the 1025-5000 range. If that is not an option push the MaxUserPort up to limit how often you end up with a conflict and try until you get the port.
    – pehrs
    Apr 13, 2010 at 15:29

1 Answer 1

1

In addition to MaxUserPort, you also need to specify ReservedPorts.

Registry Key: HKLM\System\CurrentControlSet\Services\TCPIP\Parameters

Registry Value: ReservedPorts Type: Multi-string value Value data: 1024-5000

You may also want to try only specifying 4160-4160 and not using ReservedPorts.

2
  • Thanks, I saw that but I had not realized that you could specify more than one range. Looking deeper, I see you can set multiple ranges by separating with spaces, e.g. "1433-1434 4160-4160" Apr 13, 2010 at 16:41
  • do we need to change reservedports for windows 8.1 to increase maxuserports? Mar 20, 2017 at 19:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .