8

【茶包射手筆記】清除 Windows TCP Port 保留區段

 3 years ago
source link: https://blog.darkthread.net/blog/clear-reserved-tcp-port-ranges/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
【茶包射手筆記】清除 Windows TCP Port 保留區段-黑暗執行緒

遇到老問題,Visual Studio 啟動 IISExpress 跑 ASP.NET Core 時冒出 Failed to register URL "http://localhost:59683/" for site "MyWeb" application "/". Error description: The process cannot access the file because it is being used by another process. (0x80070020)。,使用 netsh interface ipv4 show excludedportrange protocol=tcp 檢查,59683 確實踩中了 TCP Port 保留區:

但,密密麻麻 32 塊保留區(每段 100 Port)也太誇張了! 這樣子豈不一天到晚會踩到雷?爬文得知似乎是 Hyper-V 搞鬼,與 Windows NAT 服務有關,按照建議重啟 WinNAT 服務,net stop winnat 再 net start winnat,50000 以上的保留區段就只剩下 50000 - 50059。

未來再遇 TCP Port 被大量佔用,這招會比改 Port 方便一些。

and has 3 comments

Comments

Post a comment

Comment
Name Captcha 25 - 10 =

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK