Mihomo/zh: Difference between revisions
Appearance
Created page with "<syntaxhighlight lang="nix"> services.mihomo = { enable = true; configFile = "/path/to/config.yaml"; #... }; </syntaxhighlight>" |
No edit summary |
||
(11 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
<languages/> | <languages/> | ||
'''[https://github.com/MetaCubeX/mihomo/tree/Alpha mihomo]'''(原名clash-meta)是广泛使用的反审查代理工具。 | |||
'''[https://github.com/MetaCubeX/mihomo/tree/Alpha mihomo]''' | |||
在 NixOS 上启用 mihomo 服务: | |||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
Line 13: | Line 11: | ||
}; | }; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<span id="TUN_Mode"></span> | |||
=== TUN 模式 === | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
=== | NOTICE: The [https://search.nixos.org/options?channel=unstable&show=services.mihomo.tunMode&from=0&size=50&sort=relevance&type=packages&query=mihomo tunMode option] in NixOS module only grants necessary permissions for the service. To actually enable TUN, you need to edit the '''configFile'''. See [https://wiki.metacubex.one/config/inbound/listeners/tun/?h=tun official documentation]. | ||
</div> | </div> | ||
< | <span id="Troubleshooting"></span> | ||
<span | === 错误排查 === | ||
< | 如果在使用透明代理时遇到问题: | ||
* 使用 <code>dmesg</code> 检查内核日志 | |||
</ | * 如果看到大量关于特定网络设备的 refuse 消息: | ||
** NixOS 默认启用了防火墙,关掉防火墙再尝试 | |||
** 如关掉防火墙后问题解决得到解决,可以依次尝试: | |||
*** 将 tun 设备添加到 <code>trustedInterfaces</code> | |||
*** 禁用 <code>checkReversePath</code> | |||
* 如果看到大量关于特定端口的 refuse 消息: | |||
** 如果你正在使用 tproxy 透明代理,尝试在防火墙中允许 tproxy 端口。 | |||
<span id="See_also"></span> | |||
<span | == 更多参考 == | ||
<div lang="en" dir="ltr" class="mw-content-ltr"> | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
* [https://blog.nyaw.xyz/nixos-inwall-install NixOS installation and usage under a censored network (zh-cn)] | |||
</div> | </div> | ||
[[Category:Applications]] | |||
[[Category:Networking]] | |||
Latest revision as of 16:31, 28 August 2025
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
- 将 tun 设备添加到
- 如果看到大量关于特定端口的 refuse 消息:
- 如果你正在使用 tproxy 透明代理,尝试在防火墙中允许 tproxy 端口。