Jump to content

Mihomo/zh

From NixOS Wiki
Revision as of 16:31, 28 August 2025 by Weijia (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

mihomo(原名clash-meta)是广泛使用的反审查代理工具。

在 NixOS 上启用 mihomo 服务:

services.mihomo = {
  enable = true;
  configFile = "/path/to/config.yaml";
  #...
};

TUN 模式

NOTICE: The tunMode option in NixOS module only grants necessary permissions for the service. To actually enable TUN, you need to edit the configFile. See official documentation.

错误排查

如果在使用透明代理时遇到问题:

  • 使用 dmesg 检查内核日志
  • 如果看到大量关于特定网络设备的 refuse 消息:
    • NixOS 默认启用了防火墙,关掉防火墙再尝试
    • 如关掉防火墙后问题解决得到解决,可以依次尝试:
      • 将 tun 设备添加到 trustedInterfaces
      • 禁用 checkReversePath
  • 如果看到大量关于特定端口的 refuse 消息:
    • 如果你正在使用 tproxy 透明代理,尝试在防火墙中允许 tproxy 端口。

更多参考