// TUN Mode · Downloads for Every Platform

Clash Client Downloads and TUN Setup

Choose a Clash-compatible client for your system, then import config.yaml or a subscription. To route apps that ignore system proxy settings, enable the TUN virtual network interface, then check the connection log to confirm rule-based routing.

  • Open-source mihomo core
  • Chinese configuration reference

// Traffic interception and routing

Clash traffic flow and configuration fields

First check whether traffic reaches the core. Then verify that the domain resolves, which rule matched, and which outbound the policy group selected. The code examples below highlight the relevant fields for mihomo clients that support them. Use them as references; you don't need to replace your existing configuration wholesale.

  1. // STEP 01

    TUN virtual network interface

    System proxy settings only affect apps that use them. TUN routes eligible connections through a virtual network interface and system routes, making it useful for apps that ignore proxy settings. On desktop, enable TUN in the settings. If the client requests a helper service, grant permission as instructed by that client. auto-route manages the routes needed for traffic interception, while auto-detect-interface identifies the outbound network interface. If multiple interfaces or a VPN are active, disable conflicting traffic interception first, then check the logs to see whether the virtual interface was created successfully. An enabled toggle does not necessarily mean routing is working.

    config.yaml · tun
    tun:
      enable: true
      stack: mixed
      auto-route: true
      auto-detect-interface: true
  2. // STEP 02

    DNS hijacking and fake-ip

    tun.dns-hijack sends matching DNS requests to the core; dns.enhanced-mode determines how the core responds. With fake-ip, the core returns synthetic addresses for some domains and keeps a mapping between each address and its domain so later connections can still be routed by domain. Seeing a synthetic address does not by itself mean DNS resolution failed. Some LAN services rely on real DNS responses; add exceptions for the necessary domains with fake-ip-filter, then reconnect. Encrypted DNS used within an app is different from a standard query on port 53, so check which resolution path is actually in use when testing.

    config.yaml · DNS interception
    tun:
      dns-hijack:
        - any:53
    dns:
      enable: true
      enhanced-mode: fake-ip
  3. // STEP 03

    Rule-based routing and fallback order

    In mode: rule, the core checks rules from top to bottom and applies the policy for the first match. DOMAIN matches one exact domain; DOMAIN-SUFFIX matches a domain and its subdomains. Put exceptions before broader rules. Use MATCH for connections that haven't matched anything else, and keep it last. After making changes, check the matched rule in the connections panel. If you see only an IP address and no domain, first check whether the core received the domain information; don't infer the routing result from the rule syntax alone. After changing modes, test with a new connection.

    config.yaml · rules
    mode: rule
    rules:
      - DOMAIN,docs.example.com,DIRECT
      - DOMAIN-SUFFIX,example.com,Select an outbound
      - MATCH,DIRECT
  4. // STEP 04

    Choose a policy group and verify the outbound

    Rules can target a policy group instead of hard-coding an outbound in every rule. With select, choose a member manually from the client's proxy page; url-test compares members using the configured test URL and interval. Test results reflect performance against that URL and don't replace a connectivity test to your target service. The example on the right puts two built-in policies in one group to show how a rule can reference a policy group. For everyday use, configure the outbounds you need. When renaming a group, check references in rules and other groups as well. After selecting a member, verify the actual outbound with a new connection.

    config.yaml · proxy-groups
    proxy-groups:
      - name: Select an outbound
        type: select
        proxies:
          - DIRECT
          - REJECT
  5. // STEP 05

    Multiple configuration overrides and merging

    Subscription files are updated from their remote source. To keep local ports, routing exceptions, or listener settings, use the override feature provided by your client instead of repeatedly editing a downloaded subscription copy. Clients handle mappings and lists differently: a field with the same name may be replaced, while rules may be appended at a specified position. The example on the right changes only the top-level port and LAN access setting. After applying an override, inspect the configuration passed to the core and confirm that rule order and policy group references are still correct. If loading fails, disable the most recently added override first and check whether the base configuration works on its own.

    Local override · Top-level fields
    mixed-port: 7897
    allow-lan: false

Find the relevant configuration field

After the target app sends a request, check the connections panel. If no record appears, first determine whether the app uses the system proxy or the virtual network interface. For the system proxy, check whether the app follows system settings and verify the proxy address and mixed-port. For TUN, check the startup log and system routes. Avoid changing both interception methods at once, or it will be hard to tell which change restored the connection. Close existing app connections before repeating the same request. For field references, see the configuration reference.

// Downloads by platform

Choose a Clash installer for your operating system

Check your operating system and processor architecture before choosing a client. Most home computers are best served by a desktop app; consider a standalone core only if you want to manage configuration separately from the terminal or a server environment. Check each client listing on the download page for system requirements, available builds, and maintenance status.

Windows

Go to Settings → System → About to check your system type, including whether your device uses x64 or ARM, then confirm the client offers a compatible build. Import and enable the configuration in the client, then test basic connectivity with an app that uses the system proxy. To route other apps, install a service or enable TUN as directed by the client. If something goes wrong after a restart, check the service status and active configuration first.

macOS

Check your chip or processor in About This Mac, then choose the matching build for Apple silicon or Intel. On first launch, a client may separately ask to change proxy settings or install a helper service. These requests relate to system proxy and TUN features and may appear at different times. When a system prompt appears, verify the app's source and which process initiated the request, then follow the platform's installation instructions.

Android

Choose a build for your device's architecture. If you're unsure, check whether the client offers a universal build. After importing a subscription, select the profile and approve the VPN connection when prompted by the system. If another VPN is in use, check which service the system currently allows. If connections often drop when the screen locks, check the client's connection logs and the system's battery settings to tell whether background activity is paused or the configuration itself isn't working.

iOS

From the download page, open the client's App Store listing and check system compatibility. After installing, import a subscription link or local file using a method supported by the client, then follow the system prompts to add a VPN configuration. Desktop service modes and network interface switches don't apply to the mobile app. To confirm it's running, check both the active profile in the app and the system VPN status; seeing a subscription in the list isn't enough.

Linux

First check which package format your distribution uses, then verify the architecture. On desktop, prefer a GUI client compatible with your package manager. On servers, you can choose a standalone mihomo core for your architecture and manage the configuration path and startup method yourself. Desktop proxy settings may apply only to apps that support them. If enabling TUN causes problems, check the startup log for virtual interface and permission warnings, and keep a recoverable configuration before changing routes.

// Upstream projects and maintenance

Clash clients, the mihomo core, and open-source repositories

From Clash configuration to compatible clients

Clash began as a core for routing connections by rules, and a range of desktop and mobile clients grew around its configuration format. The Clash Meta fork later expanded the core and is now maintained under the name mihomo. Clash-based software isn't a single release: some tools are maintained independently for the command line, some are GUI clients with an integrated core, and others support only a subset of Clash configuration fields. Before migrating, note which core the original client uses and where its configuration came from, then check which fields can carry over. Similar names don't mean two clients will handle the same configuration in the same way.

What source code can verify

The public mihomo repository can help you check how fields are implemented, review changes, and find maintainer notes on compatibility issues. If a field name in the documentation differs from the client UI, check the generated key in the active configuration, then look up how the core parses it. For UI labels and toggle behavior, consult the client's own documentation and release notes. Distinguish the current source code from the code bundled with an installer: the default branch may include changes that haven't yet made it into the core shipped with a client. Before filing an issue, check whether the same system and trigger conditions have already been reported upstream.

Where client settings end and core configuration begins

GUI clients import configurations, manage subscriptions, and provide settings screens; the core processes listener ports, DNS, and rules from the final configuration it receives. A client may also set local ports, merge override files, or use a helper service to request system permissions. As a result, the YAML shown in an editor may not match what the core actually loads. If switching configurations makes no difference, first check whether the edited profile is active, then confirm that the client reloaded it. For errors during system authorization or service installation, start with the client logs. If a log points to a configuration key or rule, investigate that field next.

Clients, cores, and subscriptions update separately

Updating a client can change its UI or helper service and may also upgrade the core; updating a subscription mainly changes the remote configuration. When troubleshooting a failure, avoid upgrading the client, replacing the configuration, and changing TUN settings all at once. Keep a local copy of a working configuration, then make one change at a time and test with the same app on the same network. Older clients can help you compare interfaces when migrating an existing configuration; for a new installation, prefer projects that are still maintained. If local rules disappear after a subscription update, check whether they were added to a subscription file that gets replaced and whether the override is still attached to the active profile.

Keep a reproducible case before reporting an issue

Record the operating system, processor architecture, current mode, and steps that trigger the issue. For traffic interception problems, say whether interface creation failed or the interface was created but the request never reached the core. For routing problems, include the rule type, match result, and policy group name. Reproduce the issue with a public test domain and a minimal configuration where possible; don't submit your full subscription. Before sharing logs, remove subscription URLs, access credentials, and private domains. If this involves a work network or managed device, first check which proxy and routing settings you're allowed to change.

// Technical notes

Installation permissions and mixed ports

Sorted by recent updates. Mobile guides cover imports and permissions; desktop guides cover permission prompts and LAN listening scope.