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 端口。

更多參考