Jump to content

Mihomo: Difference between revisions

From NixOS Wiki
Oluceps (talk | contribs)
Prepared the page for translation
Oluceps (talk | contribs)
No edit summary
Line 1: Line 1:
<languages/>
<languages/>
<translate>
<translate>
<!--T:1-->
'''[https://github.com/MetaCubeX/mihomo/tree/Alpha mihomo]''' <span lang="en" dir="ltr">(formerly known as clash-meta), is a widely-used anti-censorship proxy application.</span>
'''[https://github.com/MetaCubeX/mihomo/tree/Alpha mihomo]''' <span lang="en" dir="ltr">(formerly known as clash-meta), is a widely-used anti-censorship proxy application.</span>


Line 15: Line 16:
=== <span lang="en" dir="ltr">TUN Mode</span> ===
=== <span lang="en" dir="ltr">TUN Mode</span> ===


<!--T:2-->
<span lang="en" dir="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].</span>
<span lang="en" dir="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].</span>


<!--T:3-->
=== <span lang="en" dir="ltr">Troubleshooting</span> ===
=== <span lang="en" dir="ltr">Troubleshooting</span> ===



Revision as of 14:50, 28 February 2025

mihomo (formerly known as clash-meta), is a widely-used anti-censorship proxy application.

Enable mihomo service on NixOS:

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

TUN Mode

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.

Troubleshooting

If encountering issues with transparent proxy:

  • Check kernel logs with dmesg
  • If seeing massive "refuse" messages for specific network devices:
    • NixOS enables firewall by default, try disabling firewall
    • If problem is solved, try sequentially:
      • Add tun device to trustedInterfaces
      • Disable checkReversePath
  • If seeing massive "refuse" messages for specific ports:
    • Try allow the tproxy port in firewall if you're trying tproxy transparent proxy.

See also