如何找出某些端口被排除的原因并删除排除?

Cil*_*lan 13 windows port

最近的 Windows 更新后,我无法再侦听端口 1433(我有远程运行的 SQL Server 并通过隧道连接到它)。

经过多次谷歌搜索后,我发现原因是这些端口已被“排除”

PS C:\Windows\system32>  netsh int ipv4 show excludedportrange protocol=tcp

Protocol tcp Port Exclusion Ranges

Start Port    End Port
----------    --------
      1114        1213
      1214        1313
      1414        1513
      1514        1613
      1614        1713
      2000        2099
     25173       25272
     50000       50059     *

* - Administered port exclusions.
Run Code Online (Sandbox Code Playgroud)

当我尝试删除排除时:

PS C:\Windows\system32> netsh int ipv4 delete excludedportrange protocol=tcp 1414 1000
Element not found.
Run Code Online (Sandbox Code Playgroud)

如何找出这些端口被排除的原因并“取消排除”它们?

我有 Windows 10 家庭版 2004。

小智 4

这可能是由于 Windows 更新或启用 Hyper-V(我认为这是我的原因)。

https://dandini.wordpress.com/2019/07/15/administered-port-exclusions-blocking-high-ports/

我将脚本保存为批处理文件,运行它并解决了我的问题。

您似乎可以运行以下命令而不是整个脚本:

reg 添加 HKLM\SYSTEM\CurrentControlSet\Services\hns\State /v EnableExcludedPortRange /d 0 /f

https://superuser.com/questions/1579346/many-excludedportranges-how-to-delete-hyper-v-is-disabled