Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

(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.

share|improve this question
    
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 '10 at 15:29
add comment

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer
    
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" –  Chris Dolan Apr 13 '10 at 16:41
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.