当前位置:网站首页>Increase the dynamic port range to solve TCPIP alarm
Increase the dynamic port range to solve TCPIP alarm
2022-06-24 05:49:00 【shawyang】
The internal and external network of the machine cannot go out , No other abnormalities found , The event viewer found that tcp/ip Several logs of the source
Increase the dynamic port range to solve tcpip The alarm
event ID4227:EVENT_TCPIP_TCP_TIME_WAIT_COLLISION
Powershell Filter :
Get-EventLog -LogName System -Source Tcpip |Where-Object {$_.EventID -eq "4227" -or $_.EventID -eq "4231" -or $_.EventID -eq "4266"} |FT TimeGenerated,EventID,EntryType,Source,Message
TCP/IP Unable to establish outgoing connection , Because the selected local endpoint was recently used to connect to the same remote endpoint . When opening and closing outgoing connections at a high rate , This will cause all available local ports to be used , And force TCP/IP Reuse the local port for outgoing connections , This error usually occurs . In order to minimize the number According to the risk of damage , In a continuous connection between a given local endpoint and a given remote endpoint , TCP/IP The standard needs to wait for the shortest period of time .
Solution :
netsh int ipv4 set dynamicport tcp start=5001 num=60535
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /v "TcpTimedWaitDelay" /t REG_DWORD /d 30 /f
this 2 The following sentence adjusts 2 Registry (s)
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
"MaxUserPort"=dword:0000f077
"TcpTimedWaitDelay"=dword:0000001e
No need to restart the machine
Be careful : stay win10 and server2019 In the system , When performing adjustment tcp Dynamic port range command , It doesn't generate automatically MaxUserPort, There is no need for human intervention , Operating system is hidden MaxUserPort; stay <win10 and server2019 In the system , Perform adjustments tcp Dynamic port range command , It will generate automatically MaxUserPort.
MaxUserPort Not the maximum user port number , It is the maximum number of user ports , The algorithm is tcp The number of ports included in the dynamic port range +1024.
Such as execution netsh int ipv4 set dynamicport tcp start=10000 num=55535 ,tcp The dynamic port range is 10000~65534, common 55535 Ports ,MaxUserPort yes 55535+1024=56559
If you execute netsh int ipv4 set dynamicport tcp start=49152 num=16384 Restoring the original dynamic range will automatically generate MaxUserPort=17408,tcp The dynamic port range is 49152 ~65535, common 16384 Ports ,MaxUserPort yes 16384+1024=17408
I usually use dynamicport tcp 5001~65535, The perform netsh int ipv4 set dynamicport tcp start=5001 num=60535
Plus
<2012R2 and Win8.1 The system of , perform :
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /v "TcpTimedWaitDelay" /t REG_DWORD /d 30 /f
≥2012R2 and Win8.1 The system of , perform :
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /v "TcpTimedWaitDelay" /t REG_DWORD /d 2 /f
Key: | HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters |
|---|---|
Value: | TcpTimedWaitDelay |
Data Type: | REG_DWORD |
Range: | Windows Server 2012 and earlier: 30-300 (decimal)Windows 8 and earlier: 30-300 (decimal)Windows Server 2012 R2 and later: 2-300 (decimal)Windows 8.1 and later: 2-300 (decimal) |
Default value: | 0x78 (120 decimal) |
Recommended value: | 30 |
Value exists by default? | No, needs to be added. |
边栏推荐
- How to make a secondary domain name? What are the advantages of secondary domain names?
- How to register a Chinese domain name? Is it necessary to register a Chinese domain name?
- How to build a website with a domain name? What steps need to be taken?
- Tencent cloud ceontos server patrol script
- How about the work domain name? Does the work domain name need real name authentication?
- Distributed background task load balancing
- Creating a database using mysqladmin
- [industry outlook] future development forecast of UHD video application
- Typora software installation
- What is the website domain name and how to register the secondary domain name?
猜你喜欢
随机推荐
"Adobe international certified" graphic designer! How to break through the creative barrier and gain both fame and wealth?
Detailed explanation of IPv6 theory and concept
The development and construction of live broadcast app, and the source code of live broadcast app involves all aspects
Massif tool of Valgrind
My two-year persistence is worth it!
How to use ffmpeg one frame H264 to decode yuv420p in audio and video development?
Where to register the HK domain name? What should I pay attention to when registering the domain name
How to build a website after successfully registering a domain name? Can I build a website without registering a domain name?
[JS reverse hundred examples] Dangle login interface parameters reverse
Explain thoroughly and learn rotten binary tree (4): storage structure of binary tree - build heap - Search - sort
The basic concept of network is the relationship among services, protocols, processes and ports.
[experience sharing] 1.39 million problem solving report of Tencent's internal track
How to do reverse domain name resolution? What does reverse domain name resolution mean?
How do individuals register domain names? What are the precautions for individual domain name registration?
How to apply for a domain name? Why should domain names be filed in advance?
How to get the website domain name? Does it cost money to apply for a website domain name?
Analysis and summary of the packet capturing artifact tcpdump - covering major use scenarios and advanced usage
How to make a secondary domain name? What is the purpose of a secondary domain name?
Select MySQL database from the command prompt window
What is the website domain name and how to register the secondary domain name?