-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
使用严格路由,会造成wsl2和docker中网络请求缓慢,且在alpine镜像中无法联网 #2957
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
这是因为 Windows 的智能多宿主导致的,我只想到一个蠢办法。 Get-NetAdapter | Where-Object { $_.Status -eq 'Up' } | ForEach-Object {
Set-DnsClientServerAddress -InterfaceIndex $_.InterfaceIndex -ServerAddresses ('0.0.0.0', '::')
启动前执行第一条重置所有网卡上的DNS,关闭后执行第二条恢复,能workaround一下,具体怎么解决估计还是得去找Windows那一坨文档。 |
确实,我现在就是这么干的,我用rust写了一个小工具执行winapi调用,然后运行sing-box,但是如果因为某些原因(比如直接重启)没有还原dhcp设置的话就会造成更麻烦的问题....甚至有时候会忘记自己设置了这个东西 |
能看下你的写法吗,我是 go 调 api 没调明白才用的 pwsh |
你要去改 |
预期行为,因此此过度杀伤功能并非默认开启。不要开启除非你清楚该功能的副作用。除非你有除了修改所有适配器的 DNS 地址以外更好的方案。 |
Operating system
Windows
System version
Windows 11 Home 26100.3915
Installation type
Original sing-box Command Line
If you are using a graphical client, please provide the version of the client.
No response
Version
Description
在sing-box中使用
在wsl2中使用nat网络模式执行nslookup,结果如下:
会报timed out错误,并且执行非常缓慢,尝试修改stack为system和gvisor仍然会出现此问题
在docker容器中都可以复现此错误,从而导致curl请求会异常缓慢
但是如果仅仅是部分场景请求缓慢我也就忍了,但是在alpine容器中甚至getaddrinfo直接无法使用
并且大多数时候网络相关的工具会出现问题(我甚至curl都装不上), 部分场景运行结果:
在一番探索下,发现关闭严格路由可以解决,
但是关闭严格路由就引入了新的问题,会造成dns泄露,
而且有时会造成dns污染,使用curl请求google有时会被解析到facebook
又在一番探索下,发现手动指定容器和wsl的dns也可以解决,但是这会引入新的问题....
想问一下,不知道有什么较为完美的方法可以解决
Reproduction
Logs
Supporter
Integrity requirements
The text was updated successfully, but these errors were encountered: