mihomo icon indicating copy to clipboard operation
mihomo copied to clipboard

[Bug] CPU占用过高,疑似ICMP回环

Open htfcuddles opened this issue 1 year ago • 20 comments

验证步骤

  • [x] 我已经阅读了 文档,了解所有我编写的配置文件项的含义,而不是大量堆砌看似有用的选项或默认值。
  • [x] 我仔细看过 文档 并未解决问题
  • [x] 我已在 Issue Tracker 中寻找过我要提出的问题,并且没有找到
  • [x] 我是中文用户,而非其他语言用户
  • [x] 我已经使用最新的 Alpha 分支版本测试过,问题依旧存在
  • [x] 我提供了可以在本地重现该问题的服务器、客户端配置文件与流程,而不是一个脱敏的复杂客户端配置文件。
  • [x] 我提供了可用于重现我报告的错误的最简配置,而不是依赖远程服务器或者堆砌大量对于复现无用的配置等。
  • [x] 我提供了完整的日志,而不是出于对自身智力的自信而仅提供了部分认为有用的部分。
  • [x] 我直接使用 Mihomo 命令行程序重现了错误,而不是使用其他工具或脚本。

操作系统

No response

系统版本

Windows 11

Mihomo 版本

Mihomo Meta alpha-ff76576 windows amd64 with go1.25.3

配置文件

mode: rule
redir-port: 1111
mixed-port: 2222
allow-lan: false
log-level: error
ipv6: false
external-controller: ''
secret: xxxx
unified-delay: true
external-ui: /usr/share/openclash/ui
find-process-mode: always
geodata-loader: standard
disable-icmp-forwarding: true
external-controller-pipe: \\.\pipe\verge-mihomo
bind-address: '*'
sniffer:
  enable: true
  force-dns-mapping: true
  parse-pure-ip: true
dns:
  enable: true
  ipv6: false
  enhanced-mode: redir-host
  fake-ip-range: 198.18.0.1/16
  fake-ip-filter-mode: blacklist
  listen: 0.0.0.0:3333
  nameserver:
  - 127.0.0.1:4444
  fallback:
  - 127.0.0.1:4444
  default-nameserver:
  - https://223.5.5.5/dns-query
  proxy-server-nameserver:
  - https://doh.pub/dns-query
  fallback-filter:
    geoip: true
    geoip-code: CN
    ipcidr:
    - 0.0.0.0/8
    - 10.0.0.0/8
    - 100.64.0.0/10
    - 127.0.0.0/8
    - 169.254.0.0/16
    - 172.16.0.0/12
    - 192.0.0.0/24
    - 192.0.2.0/24
    - 192.88.99.0/24
    - 192.168.0.0/16
    - 198.18.0.0/15
    - 198.51.100.0/24
    - 203.0.113.0/24
    - 224.0.0.0/4
    - 240.0.0.0/4
    - 255.255.255.255/32
    domain:
    - +.google.com
    - +.facebook.com
    - +.youtube.com
    - +.githubusercontent.com
    - +.googlevideo.com
    - www.bing.com
    - cdn.jsdelivr.net
    - '*.lan'
    - '*.local'
    - '*.msftncsi.com'
    - '*.msftconnecttest.com'
  respect-rules: false
  fake-ip-filter:
  - dns.msftncsi.com
  - www.msftncsi.com
  - www.msftconnecttest.com
profile:
  store-selected: true
  store-fake-ip: true
tun:
  auto-detect-interface: true
  auto-route: true
  device: Meta
  dns-hijack:
  - any:53
  mtu: 1480
  stack: mixed
  strict-route: false
  enable: true
geodata-mode: true
tcp-concurrent: true
proxies:
## DELETED
proxy-groups:
## DELETED
rules:
## DELETED

描述

CPU占用率异常飙高,用Wireshark抓包Meta接口,发现大量来自外网地址的ICMP响应包,截图如下

Image

但没有发现来自本地接口的ICMP请求包。另外,以太网抓包未发现异常。 加上全局disable-icmp-forwarding: true未解决问题。 考虑到在配置中无法设置针对ICMP设置规则,疑似是程序Bug导致的ICMP本地回环。

重现方式

正常启动客户端

日志

[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.377819300+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 12479 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.379412500+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 61845 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.380512300+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 5598 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.382664800+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 6523 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.346758800+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 65535 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.379412500+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 34342 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.379412500+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 17043 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.379412500+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 6979 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.379412500+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 0 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.379412500+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 35545 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.379412500+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 49367 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.377819300+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 61648 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.378328200+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 30305 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.377819300+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 36267 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.379954000+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 51222 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.380512300+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 65535 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.382664800+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 35230 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.382664800+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 16168 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.381598600+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 41939 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.381598600+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 16934 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.382664800+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 30305 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.382664800+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 49367 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.381598600+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 31282 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.379954000+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 0 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.382664800+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 34253 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.382664800+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 65535 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.382664800+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 16168 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.381047600+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 40886 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.382664800+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 0 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.382128200+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 0 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.382664800+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 65535 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.382664800+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 65535 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.382664800+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 65535 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.382664800+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 0 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.382664800+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 0 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.381047600+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 61181 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.382664800+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 65535 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.381047600+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 65535 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.381047600+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 37811 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.382128200+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 22793 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.383186800+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 65535 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.382664800+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 53056 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.382128200+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 30380 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.382664800+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 3690 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.383186800+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 35155 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.383186800+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 61845 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.383186800+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 30380 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.382664800+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 45965 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.383186800+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 3690 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.383186800+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 61845 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.383186800+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 19570 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.379412500+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 52874 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.380512300+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 13909 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.383186800+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 51626 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.383186800+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 45965 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.383186800+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 19570 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.381598600+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 35787 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.383186800+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 47390 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.383186800+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 29748 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.383186800+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 18145 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.383186800+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 35787 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.383186800+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 47390 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.383186800+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 29748 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.383713200+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 18145 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.383713200+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 35787 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.383713200+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 47390 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.383713200+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 29748 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.383713200+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 18145 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.383713200+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 35787 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.383713200+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 47390 seq 0"
[2025-11-21 15:53:40.386] time="2025-11-21T15:53:40.383713200+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 29748 seq 0"
[2025-11-21 15:53:40.387] time="2025-11-21T15:53:40.383713200+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 18145 seq 0"
[2025-11-21 15:53:40.387] time="2025-11-21T15:53:40.381598600+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 65535 seq 0"
[2025-11-21 15:53:40.387] time="2025-11-21T15:53:40.383713200+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 0 seq 0"
[2025-11-21 15:53:40.387] time="2025-11-21T15:53:40.380512300+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 65535 seq 0"
[2025-11-21 15:53:40.387] time="2025-11-21T15:53:40.380512300+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 47467 seq 0"
[2025-11-21 15:53:40.387] time="2025-11-21T15:53:40.380512300+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 3389 seq 0"
[2025-11-21 15:53:40.387] time="2025-11-21T15:53:40.380512300+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 42069 seq 0"
[2025-11-21 15:53:40.387] time="2025-11-21T15:53:40.380512300+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 26414 seq 0"
[2025-11-21 15:53:40.387] time="2025-11-21T15:53:40.377819300+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 33380 seq 0"
[2025-11-21 15:53:40.387] time="2025-11-21T15:53:40.378884400+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 26182 seq 0"
[2025-11-21 15:53:40.387] time="2025-11-21T15:53:40.381047600+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 54279 seq 0"
[2025-11-21 15:53:40.387] time="2025-11-21T15:53:40.379954000+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 61052 seq 0"
[2025-11-21 15:53:40.387] time="2025-11-21T15:53:40.381598600+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 4216 seq 0"
[2025-11-21 15:53:40.387] time="2025-11-21T15:53:40.382664800+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 29268 seq 0"
[2025-11-21 15:53:40.387] time="2025-11-21T15:53:40.379954000+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 65535 seq 0"
[2025-11-21 15:53:40.387] time="2025-11-21T15:53:40.382664800+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 35230 seq 0"
[2025-11-21 15:53:40.387] time="2025-11-21T15:53:40.381598600+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 42357 seq 0"
[2025-11-21 15:53:40.387] time="2025-11-21T15:53:40.382128200+08:00" level=debug msg="read ICMPv4 echo reply from xxx.xxx.xxx.xxx to 198.18.0.1 id 20500 seq 0"

htfcuddles avatar Nov 21 '25 07:11 htfcuddles

@htfcuddles disable-icmp-forwarding 是在 tun 下设置的

wwqgtxx avatar Nov 21 '25 07:11 wwqgtxx

@wwqgtxx 谢谢,暂时已规避。请问回环的原因有头绪吗?除了全局禁用ICMP,配置文件上好像没有避免的方法。我还是希望开启ICMP的。

htfcuddles avatar Nov 21 '25 07:11 htfcuddles

是否使用了tailscale,我使用了有此问题

minortex avatar Nov 21 '25 17:11 minortex

我也有相似的问题,即使清空所有用户进程,流量监控器 TrafficMonitor也检测到持续 3MB/s 的下行流量,但任务管理器也只显示Mihomo核心进程有网络占用。(Mihomo核心的CPU占用率倒是没有很高,好像在15%左右,(整机45%))

等待一段时间后依然持续,直到重启核心后恢复正常。

故障情况暂时没法准确复现。

我的情况是:

  • 将以太网禁用并切换至WLAN

    // 没有捕捉到任何程序
    21:38:16 debug read ICMPv4 echo reply from 114.114.114.114 to 198.18.0.1 id 59331 seq 0
    21:38:16 debug read ICMPv4 echo reply from 114.114.114.114 to 198.18.0.1 id 59331 seq 0
    21:38:16 debug read ICMPv4 echo reply from 114.114.114.114 to 198.18.0.1 id 6204 seq 0
    
  • 游玩《崩坏:星穹铁道》

    // 最后一次捕捉到`StarRail.exe`引发的洪水
    15:01:53	debug  	read ICMPv4 echo reply from 139.196.107.179 to 198.18.0.1 id 38860 seq 6400
    15:01:53	debug  	read ICMPv4 echo reply from 139.196.107.179 to 198.18.0.1 id 38860 seq 6144
    15:56:50	debug  	read ICMPv4 echo reply from 47.101.130.185 to 198.18.0.1 id 27580 seq 2048
    15:56:50	debug  	read ICMPv4 echo reply from 47.101.130.185 to 198.18.0.1 id 37955 seq 1280
    15:56:50	debug  	read ICMPv4 echo reply from 47.101.130.185 to 198.18.0.1 id 37955 seq 512
    15:56:50	debug  	read ICMPv4 echo reply from 47.101.130.185 to 198.18.0.1 id 37955 seq 7680
    

配置文件:

port: 7897
socks-port: 7891
redir-port: 7892
mixed-port: 7893
allow-lan: false
bind-address: "*"
ipv6: false
mode: rule
log-level: info
tcp-concurrent: true
unified-delay: true
global-client-fingerprint: chrome

# GEO
geodata-mode: true
geodata-loader: standard 
geo-auto-update: true
geo-update-interval: 12
geox-url:
  geosite: "https://github.com/v2fly/domain-list-community/releases/latest/download/dlc.dat"

# 外部控制器配置
external-controller: 127.0.0.1:9090
secret: ""
external-ui: ./ui
external-ui-name: zashboard
external-ui-url: "https://github.com/Zephyruso/zashboard/archive/refs/heads/gh-pages.zip"

clash-for-android:
  append-system-dns: false

profile:
  store-selected: true
  store-fake-ip: true

# TUN 配置
tun:
  enable: true
  stack: mixed
  dns-hijack:
    - any:53
    - tcp://any:53
  device: Mihomo
  auto-route: true
  auto-redirect: true
  auto-detect-interface: true
  strict-route: true

# DNS 配置
dns:
  enable: true
  reject-private: true
  cache-algorithm: arc
  prefer-h3: false
  listen: 0.0.0.0:1053
  ipv6: false
  use-hosts: true
  respect-rules: true
  enhanced-mode: fake-ip
  fake-ip-range: 198.18.0.1/16
  fake-ip-filter-mode: blacklist
  fake-ip-filter:
    - "+.lan"
    - "+.local"
    - "localhost"
    - "home.arpa"
    - "local.adguard.org"
    - "geosite:private"
    - "geosite:connectivity-check"
    - "geosite:cn"
    - "geosite:tld-cn"
    - "geosite:geolocation-cn"
    - "geosite:geolocation-!cn@cn"


  default-nameserver:
    - 223.5.5.5                         # 阿里(UDP)
    - 119.29.29.29                      # 腾讯Pod 备用

  proxy-server-nameserver:
    - 223.5.5.5                         # 阿里(UDP)
    - 119.29.29.29                      # 腾讯Pod 备用
  
  direct-nameserver:
    - quic://dns.alidns.com:853        # 阿里 DoQ
    - https://doh.pub/dns-query        # 腾讯 DNSPod DoH
    - https://dns.alidns.com/dns-query # 阿里 DoH

  nameserver:
    - quic://dns.alidns.com:853        # 阿里 DoQ
    - https://doh.pub/dns-query        # 腾讯 DNSPod DoH
    - https://dns.alidns.com/dns-query # 阿里 DoH

# 嗅探配置
sniffer:
  enable: true
  sniff:
    HTTP:
      ports: [80, 8080-8880]
      override-destination: true
    TLS:
      ports: [443, 8443]
      override-destination: true
    QUIC:
      ports: [443, 8443]
  skip-domain:
    - "Mijia Cloud"
    - dlg.io.mi.com
  parse-pure-ip: true
  force-dns-mapping: true
  override-destination: true

ReRokutosei avatar Nov 23 '25 11:11 ReRokutosei

这个 ICMP 问题打了上万个连接出去。。

Image

lwQin avatar Nov 24 '25 02:11 lwQin

我也有相似的问题,即使清空所有用户进程,流量监控器 TrafficMonitor也检测到持续 3MB/s 的下行流量,但任务管理器也只显示Mihomo核心进程有网络占用。(Mihomo核心的CPU占用率倒是没有很高,好像在15%左右,(整机45%))

等待一段时间后依然持续,直到重启核心后恢复正常。

故障情况暂时没法准确复现。

我的情况是:

  • 将以太网禁用并切换至WLAN
    // 没有捕捉到任何程序
    21:38:16 debug read ICMPv4 echo reply from 114.114.114.114 to 198.18.0.1 id 59331 seq 0
    21:38:16 debug read ICMPv4 echo reply from 114.114.114.114 to 198.18.0.1 id 59331 seq 0
    21:38:16 debug read ICMPv4 echo reply from 114.114.114.114 to 198.18.0.1 id 6204 seq 0
    
  • 游玩《崩坏:星穹铁道》
    // 最后一次捕捉到`StarRail.exe`引发的洪水
    15:01:53	debug  	read ICMPv4 echo reply from 139.196.107.179 to 198.18.0.1 id 38860 seq 6400
    15:01:53	debug  	read ICMPv4 echo reply from 139.196.107.179 to 198.18.0.1 id 38860 seq 6144
    15:56:50	debug  	read ICMPv4 echo reply from 47.101.130.185 to 198.18.0.1 id 27580 seq 2048
    15:56:50	debug  	read ICMPv4 echo reply from 47.101.130.185 to 198.18.0.1 id 37955 seq 1280
    15:56:50	debug  	read ICMPv4 echo reply from 47.101.130.185 to 198.18.0.1 id 37955 seq 512
    15:56:50	debug  	read ICMPv4 echo reply from 47.101.130.185 to 198.18.0.1 id 37955 seq 7680
    

我也是类似,在重启内核后,打开了《绝区零》,看到任务管理器中内核cpu从0~1%飙升到15%左右,打开Wireshark抓包,简单统计:在34.5秒内,有102万+的发包,内容与下类似,Info信息有一定规律

No.      Time      Source        Destination Protocol  Length              Info
1027169  34.558207 203.107.62.16	198.18.0.1  ICMP        84         Echo (ping) reply    id=0xd42a, seq=1024/4, ttl=54
Image

经IP反查,203.107.62.16为游戏《绝区零》服务器地址,目前通过下面的方法复现: 在没有设置disable-icmp-forwarding为true时,启动《绝区零》并登录账号,提示登录成功后,问题复现,出现在登录之后 当设置disable-icmp-forwarding为true时,问题消失

ewpef avatar Nov 24 '25 15:11 ewpef

试试 https://github.com/MetaCubeX/mihomo/commit/66781a50a05d84b29ac67786228ce2f3e9894b33

wwqgtxx avatar Nov 24 '25 16:11 wwqgtxx

@wwqgtxx https://github.com/MetaCubeX/mihomo/commit/66781a50a05d84b29ac67786228ce2f3e9894b33 试了但问题依旧

htfcuddles avatar Nov 25 '25 06:11 htfcuddles

经IP反查,203.107.62.16为游戏《绝区零》服务器地址,目前通过下面的方法复现: 在没有设置disable-icmp-forwarding为true时,启动《绝区零》并登录账号,提示登录成功后,问题复现,出现在登录之后 当设置disable-icmp-forwarding为true时,问题消失

通过上述方法复现得到 *理想结果(禁用icmp forwarding后)*一个request对应一个reply Image

*异常情况(未禁用icmp forwarding)*下面为大量Echo (ping) reply Image

(未禁用icmp forwarding)通过对出口网卡抓包,对比Tun网卡,同样有32个Echo (ping) request包,出口网卡接受32个reply包后,正常一个request对应一个reply,而Tun网卡出现大量reply包,并且一次性有32个Echo (ping) request包也是不正常的

ewpef avatar Nov 25 '25 16:11 ewpef

v1.19.16

Image

romanholidaypancakes avatar Nov 30 '25 07:11 romanholidaypancakes

所以有其他人尝试过手动替换 https://github.com/MetaCubeX/mihomo/actions/runs/19640872499 里的文件后表现如何么

wwqgtxx avatar Nov 30 '25 07:11 wwqgtxx

所以有其他人尝试过手动替换 https://github.com/MetaCubeX/mihomo/actions/runs/19640872499 里的文件后表现如何么

尝试了windows-amd64,问题没有复现,(未禁用icmp forwarding,抓包Tun网卡)不过依然有32个Echo (ping) request包,reply 32个包后,正常一个request对应一个reply,但无伤大雅

ewpef avatar Nov 30 '25 07:11 ewpef

这个问题应该是在Tun模式关闭Fake-IP下能重现。 有问题的代码可能在判断是否需要注入ICMP这块 https://github.com/MetaCubeX/mihomo/blob/a001b1b11008ba469442e5e59b058dd032263470/listener/sing_tun/prepare.go#L19-L23 出问题的包目标地址是Tun接口网关地址,resolver.IsFakeIP会跳过网关地址,重新注入生成ICMP https://github.com/MetaCubeX/mihomo/blob/a001b1b11008ba469442e5e59b058dd032263470/dns/enhancer.go#L56

根本原因如下

  • TUN 路由规则问题:Alpha 分支的 sing-tun 更新(v0.4.8)加强了入站包的 hijack,但没有过滤 ICMP reply 的方向(incoming vs outgoing)。所有进出 TUN 的 ICMP 都触发 PrepareConnection。

  • 没有来源 IP 检查:函数只看 destination.Addr,没检查 originalDestination 或 packet 的源 IP 是否是本地/外网。如果源 IP 是外网,应该是响应,不应处理。

  • 配置选项 disable-icmp-forwarding(新增在 v1.19.14)正是为了缓解此问题:它在 TUN 配置中添加一个 flag,如果启用,会在 PrepareConnection 开头添加 if lh.config.DisableICMPForwarding { return nil, nil },强制跳过所有 ICMP。但这是 workaround,不是根治。

以上部分是AI得出结论,手头没有编译环境,有哪位帮忙试一下?

htfcuddles avatar Dec 01 '25 03:12 htfcuddles

所以有其他人尝试过手动替换 https://github.com/MetaCubeX/mihomo/actions/runs/19640872499 里的文件后表现如何么

使用最新release有从睡眠唤醒后cpu占用高达30%的问题,使用此action编译的版本,目前没有遇到问题

minortex avatar Dec 01 '25 03:12 minortex

所以有其他人尝试过手动替换 https://github.com/MetaCubeX/mihomo/actions/runs/19640872499 里的文件后表现如何么

我使用的版本均为mihomo-windows-amd64-v3

  • disable-icmp-forwarding: true
    • Release v1.19.16
      • (11月23日、11月24日) 启用该配置字段无效,问题依然存在。表现为启动《星穹铁道》立即开始出现大量read ICMPv4 echo reply记录。
      • 后续保持config.yaml不变,不再理会。
      • 11月24日至今,没有刻意观察,但在游玩《星穹铁道》或切换有线/无线网络时,已无法复现问题。
      • 尝试的方法包括:通过zash webUI面板重载配置、通过winsw.exe重启核心服务、重启电脑。
    • Action Run alpha-66781a5 无法复现问题。

  • # disable-icmp-forwarding: true
# log记录正常
16:21:36 debug read ICMPv4 echo reply from 203.107.60.122 to 198.18.0.1 id 58393 seq 3073
16:21:36 debug write ICMPv4 echo request from 198.18.0.1 to 203.107.60.122 id 58393 seq 3073

~~有没有可能是米哈游的问题?~~

ReRokutosei avatar Dec 01 '25 08:12 ReRokutosei

@wwqgtxx 今天又重试了https://github.com/MetaCubeX/mihomo/actions/runs/19640872499 貌似解决了。

htfcuddles avatar Dec 01 '25 08:12 htfcuddles

最新Release v1.19.17 已经包含该commit

wwqgtxx avatar Dec 01 '25 08:12 wwqgtxx

@wwqgtxx 最新Release v1.19.17 复测了一下,问题已解决。非常感谢。

htfcuddles avatar Dec 01 '25 08:12 htfcuddles

Debian 环境下测试 v1.19.17 还是会有大量 ICMP 包,而且从机器上 ping 需要代理的地址也是无响应的

Dec 01 17:00:53 clash clash[26486]: time="2025-12-01T17:00:53.433173391+08:00" level=debug msg="write ICMPv4 echo reque>
Dec 01 17:00:53 clash clash[26486]: time="2025-12-01T17:00:53.433233575+08:00" level=debug msg="write ICMPv4 echo reque>
Dec 01 17:00:53 clash clash[26486]: time="2025-12-01T17:00:53.433301618+08:00" level=debug msg="write ICMPv4 echo reque>
Dec 01 17:00:53 clash clash[26486]: time="2025-12-01T17:00:53.433363053+08:00" level=debug msg="write ICMPv4 echo reque>
Dec 01 17:00:53 clash clash[26486]: time="2025-12-01T17:00:53.433424830+08:00" level=debug msg="write ICMPv4 echo reque>
Dec 01 17:00:53 clash clash[26486]: time="2025-12-01T17:00:53.433486166+08:00" level=debug msg="write ICMPv4 echo reque>
Dec 01 17:00:53 clash clash[26486]: time="2025-12-01T17:00:53.433554781+08:00" level=debug msg="write ICMPv4 echo reque>
Dec 01 17:00:53 clash clash[26486]: time="2025-12-01T17:00:53.433626089+08:00" level=debug msg="write ICMPv4 echo reque>
Dec 01 17:00:53 clash clash[26486]: time="2025-12-01T17:00:53.433700549+08:00" level=debug msg="write ICMPv4 echo reque>
Dec 01 17:00:53 clash clash[26486]: time="2025-12-01T17:00:53.433775653+08:00" level=debug msg="write ICMPv4 echo reque>
Image

配置

mixed-port: 7890
allow-lan: true
unified-delay: false
  #disable-icmp-forwarding: true
tcp-concurrent: true
external-controller: :9090
external-ui: ui
external-ui-url: 'https://github.com/MetaCubeX/metacubexd/archive/refs/heads/gh-pages.zip'
ipv6: false
find-process-mode: off

geodata-mode: false
geodata-loader: standard
geo-auto-update: true
geo-update-interval: 6
geox-url:
  geosite: https://ghfast.top/https://github.com/v2fly/domain-list-community/releases/latest/download/dlc.dat
  mmdb: https://ghfast.top/https://raw.githubusercontent.com/Loyalsoldier/geoip/release/GeoLite2-Country.mmdb
  geoip: https://ghfast.top/https://github.com/v2ray/geoip/raw/release/geoip.dat
  asn: https://ghfast.top/https://raw.githubusercontent.com/Loyalsoldier/geoip/release/GeoLite2-ASN.mmdb
global-client-fingerprint: chrome

profile:
  store-selected: true
  store-fake-ip: true

mode: rule
log-level: debug

tun:
  enable: true
  stack: mixed
  auto-route: true
  auto-detect-interface: true

dns:
  enable: true
  listen: :5353
  ipv6: false
  prefer-h3: true
  enhanced-mode: redir-host
  nameserver-policy:
    "geosite:cn,private,apple":
      - https://223.5.5.5/dns-query
      - https://223.6.6.6/dns-query
    "geosite:geolocation-!cn":
      - https://1.1.1.1/dns-query#Proxy
      - https://1.0.0.1/dns-query#Proxy
      - https://8.8.8.8/dns-query#Proxy
      - https://8.8.4.4/dns-query#Proxy
  proxy-server-nameserver:
    - https://223.5.5.5/dns-query
    - https://223.6.6.6/dns-query

sniffer:
  enable: true
  force-dns-mapping: false
  parse-pure-ip: true
  override-destination: false
  sniff:
    HTTP:
      ports: [80, 8080-8880]
    TLS:
      ports: [443, 8443]
    QUIC:
      ports: [443, 8443]

proxies:

lwQin avatar Dec 01 '25 09:12 lwQin

@wwqgtxx 大佬 比较多的这个错误日志 运行mihomo内核在mac和ios上都有这个告警 我看了代码定位不到哪里打的错误日志 需要关注吗 +00002025-12-1906:15:19error receive lCMP echo reply:read udp 0.0.0.0:0->120.232.51.126:0:i/o timeout +0000 2025-12-1906:15:20error receive lCMP echo reply:read udp 0.0.0.0:0->112.53.55.225:0:i/o timeout +0000 2025-12-1906:15:26error receive lCMP echo reply:read udp 0.0.0.0:0->112.53.48.195:0:i/o timeout +0000 2025-12-19 06:15:28error receive lCMP echo reply:read udp 0.0.0.0:0->120.233.23.111:0:i/o timeout

我经常收到 类似的这些错误日志

tun:
  stack: gvisor
  device: utun9
  auto-route: true
  auto-redirect: true
  strict-route: true
  auto-detect-interface: true
  disable-icmp-forwarding: false # 我需要使用正常的ping
  __route-address:
    - 198.18.0.0/16
  dns-hijack:
    - any:53
  mtu: 4064
  enable: true

HEUDavid avatar Dec 19 '25 07:12 HEUDavid