txthinking / brook

A cross-platform programmable network tool
https://brook.app
GNU General Public License v3.0
14.6k stars 2.4k forks source link

远程计算机拒绝网络连接 或 http://127.0.0.1:59789 页面无法访问 #1155

Open duanluan opened 1 year ago

duanluan commented 1 year ago

根本原因其实是端口 59789 被占用了,因为我 Hyper-V 的保留端口调整为 50000 ~ 65539 的。 没想到 brook 会用这么大的端口,不行我就再调大一点吧。 以下方案同样适用于Client: 127.0.0.1:1080 already in use但是netstat -ano|findstr 1080没找到端口占用的情况。

# 查看端口占用范围
$ netsh int ipv4 show dynamicport tcp
# 查看端口排除范围
$ netsh interface ipv4 show excludedportrange protocol=tcp
# 关闭 Hyper-V,可以不重启
$ dism.exe /Online /Disable-Feature:Microsoft-Hyper-V
# 修改动态端口范围,num=65535-start
$ netsh int ipv4 set dynamicport tcp start=60000 num=5535
$ netsh int ipv4 set dynamicport udp start=60000 num=5535
# 开启 Hyper-V 并重启(注销不行)
$ dism.exe /Online /Enable-Feature:Microsoft-Hyper-V /All
txthinking commented 1 year ago

非常好的经验分享

On Fri, Mar 24, 2023 at 12:54 PM 欲穷三千界 @.***> wrote:

根本原因其实是端口 59789 被占用了,因为我 Hyper-V 的保留端口调整为 50000 ~ 65539 的。 没想到 brook 会用这么大的端口,不行我就再调大一点吧。 以下方案同样适用于Client: 127.0.0.1:1080 already in use但是netstat -ano|findstr 1080 没找到端口占用的情况。

查看端口占用范围

$ netsh int ipv4 show dynamicport tcp# 查看端口排除范围 $ netsh interface ipv4 show excludedportrange protocol=tcp# 关闭 Hyper-V,可以不重启 $ dism.exe /Online /Disable-Feature:Microsoft-Hyper-V# 修改动态端口范围,num=65535-start $ netsh int ipv4 set dynamicport tcp start=60000 num=65535 $ netsh int ipv4 set dynamicport udp start=60000 num=65535# 开启 Hyper-V 并重启(注销不行) $ dism.exe /Online /Enable-Feature:Microsoft-Hyper-V /All

— Reply to this email directly, view it on GitHub https://github.com/txthinking/brook/issues/1155, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJPFT2XKYB56QU3FDXHNK3W5USHPANCNFSM6AAAAAAWGCUNOU . You are receiving this because you are subscribed to this thread.Message ID: @.***>