[Bug] v1.15.0和v1.15.1在Linux上开启tun无法正常联网
Verify steps
- [X] 确保你使用的是本仓库最新的的 clash 或 clash Alpha 版本 Ensure you are using the latest version of Clash or Clash Premium from this repository.
- [X] 如果你可以自己 debug 并解决的话,提交 PR 吧 Is this something you can debug and fix? Send a pull request! Bug fixes and documentation fixes are welcome.
- [X] 我已经在 Issue Tracker 中找过我要提出的问题 I have searched on the issue tracker for a related issue.
- [ ] 我已经使用 Alpha 分支版本测试过,问题依旧存在 I have tested using the dev branch, and the issue still exists.
- [X] 我已经仔细看过 Documentation 并无法自行解决问题 I have read the documentation and was unable to solve the issue.
- [X] 这是 Clash 核心的问题,并非我所使用的 Clash 衍生版本(如 OpenClash、KoolClash 等)的特定问题 This is an issue of the Clash core per se, not to the derivatives of Clash, like OpenClash or KoolClash.
Clash version
v1.15.0
What OS are you seeing the problem on?
Linux
Clash config
port: 7890
socks-port: 7891
allow-lan: false
mode: Rule
log-level: debug
external-controller: 127.0.0.1:9090
proxies:
# ...
proxy-groups:
# ...
rules:
# ...
tun:
enable: true
stack: gvisor # 使用system也有问题
auto-route: true
auto-detect-interface: true
dns-hijack:
- any:53
Clash log
INFO[2023-08-27T19:56:22.484318283+08:00] Start initial configuration in progress
INFO[2023-08-27T19:56:22.486366703+08:00] Geodata Loader mode: memconservative
INFO[2023-08-27T19:56:22.487199998+08:00] Initial configuration complete, total time: 2ms
INFO[2023-08-27T19:56:22.490706711+08:00] RESTful API listening at: 127.0.0.1:9090
INFO[2023-08-27T19:56:22.500236701+08:00] Sniffer is closed
INFO[2023-08-27T19:56:22.500344053+08:00] HTTP proxy listening at: 127.0.0.1:7890
INFO[2023-08-27T19:56:22.500439382+08:00] SOCKS proxy listening at: 127.0.0.1:7891
WARN[2023-08-27T19:56:22.500767698+08:00] [TUN] default interface changed by monitor, => eth0
INFO[2023-08-27T19:56:22.51965576+08:00] [TUN] Tun adapter listening at: Meta([198.18.0.1/30],[]), mtu: 9000, auto route: true, ip stack: gVisor
INFO[2023-08-27T19:56:22.520001733+08:00] Start initial compatible provider default
INFO[2023-08-27T19:56:22.520060744+08:00] Start initial compatible provider XXX
DEBU[2023-08-27T19:56:22.536158135+08:00] [DNS] hijack udp:198.18.0.2:53 from 198.18.0.1:46321
DEBU[2023-08-27T19:56:24.537240207+08:00] [DNS] hijack udp:198.18.0.2:53 from 198.18.0.1:47447
DEBU[2023-08-27T19:56:25.26302075+08:00] [DNS] hijack udp:198.18.0.2:53 from 198.18.0.1:36471
DEBU[2023-08-27T19:56:25.263790741+08:00] [DNS] hijack udp:198.18.0.2:53 from 198.18.0.1:59572
WARN[2023-08-27T20:33:03.672795104+08:00] [TCP] dial SELECT (match Match/) 127.0.0.1:36060(firefox, uid=1000) --> detectportal.firefox.com:80 error: xxx.xxx.xxx:xxx connect error: dns resolve failed: lookup xxx.xxx.xxx on 127.0.0.53:53: server misbehaving
WARN[2023-08-27T20:33:03.672795104+08:00] [TCP] dial SELECT (match Match/) 127.0.0.1:36060(firefox, uid=1000) --> detectportal.firefox.com:80 error: xxx.xxx.xxx:xxx connect error: dns resolve failed: lookup xxx.xxx.xxx on 127.0.0.53:53: server misbehaving
WARN[2023-08-27T20:33:03.672795104+08:00] [TCP] dial SELECT (match Match/) 127.0.0.1:36060(firefox, uid=1000) --> detectportal.firefox.com:80 error: xxx.xxx.xxx:xxx connect error: dns resolve failed: lookup xxx.xxx.xxx on 127.0.0.53:53: server misbehaving
Description
目前测试结果主要是v1.15.0和v1.15.1的问题,v1.14.5一切正常。在Ubuntu LTS 22.04和20.04都测试过,amd64和arm64也测试了,可能是Linux通病。
复现方法:
- 随便找一个云服务厂商新建Ubuntu Linux VPS实例
- 填写任意节点配置,追加TUN相关配置
- 使用sudo运行clash.meta核心
- 使用nslookup查询任意域名都会查询失败,如果使用
curl "http://127.0.0.1:9090/proxies/节点名/delay?timeout=6000&url=http:%2F%2Fwww.gstatic.com%2Fgenerate_204",都会显示An error occurred in the delay test
貌似v1.14.5在arm64的Linux系统上也有问题。
v1.14.5在Ubuntu 20.04 LTS仍然有问题,不过v1.14.5在Ubuntu 22.04LTS正常。
v.14.5在Fedora 36也正常。可能v1.14.5的问题只在于不兼容较老的Linux发行版本。
但是v1.15.0和v1.15.1的问题在新旧Linux发行版本上都存在。
实测Archlinux上没问题,感觉可能是config.yml里dns配置的问题
实测Archlinux上没问题,感觉可能是config.yml里dns配置的问题
感谢提醒,我去试试。
实测Archlinux上没问题,感觉可能是config.yml里dns配置的问题
大佬,DNS相关配置如下,还是不能用,请问该如何修改:
dns:
enable: true
ipv6: true
enhanced-mode: redir-host
listen: 127.0.0.1:843
default-nameserver:
- 114.114.114.114
- 8.8.8.8
- tls://1.12.12.12:853
- tls://223.5.5.5:853
nameserver:
- https://doh.pub/dns-query
- https://dns.alidns.com/dns-query
fallback:
- tls://8.8.4.4
- tls://1.1.1.1
proxy-server-nameserver:
- https://doh.pub/dns-query
fallback-filter:
geoip: true
geoip-code: CN
ipcidr:
- 240.0.0.0/4
domain:
- +.google.com
- +.facebook.com
- +.youtube.com
sniffer:
enable: true
换fakeip就正常了,redir-host我也用着总是这里那里有问题的。