1. What TUN mode does—and when you need it
Clash Meta TUN mode creates a virtual network interface on Windows and redirects traffic from the operating system into the Clash or Mihomo routing engine. Instead of depending on every application to understand an HTTP or SOCKS5 proxy, TUN mode works closer to the network layer. Browsers, terminals, game launchers, desktop applications, and background services can therefore follow the same proxy rules even when they do not offer a proxy field in their own settings.
This is different from enabling the ordinary system proxy switch. The system proxy normally advertises an HTTP proxy address, such as 127.0.0.1:7890, to applications that explicitly read Windows proxy settings. Many Chromium-based applications do, but command-line tools, games, virtual machines, Docker components, update services, and native Windows programs may ignore that setting. TUN mode is useful when a browser works through Clash while another application still connects directly, times out, or resolves a domain through the wrong DNS server.
The trade-off is that TUN mode requires deeper system access. Windows must create and manage a virtual adapter, Clash needs permission to install or control it, and the selected DNS strategy must be compatible with the profile. A poorly prepared setup can cause duplicate adapters, broken local-network access, DNS loops, or a situation where the interface appears active but no traffic reaches a proxy node. The safest approach is to configure one change at a time and verify each layer before moving on.
This guide targets users running a current Clash Meta or Mihomo-compatible client on Windows, including Clash Verge Rev and similar desktop clients. Interface names differ slightly between releases, but the underlying concepts remain the same: enable TUN, grant elevated permission, select a compatible stack, define DNS behavior, and confirm the result with both Clash logs and Windows network tests.
Important: TUN mode changes routing for the whole computer. Before enabling it on a work device, check your organization’s proxy, VPN, security, and data-routing policies.
2. Prepare the client and profile
Start with a client that actually includes a Mihomo or Clash Meta core. The application name alone is not enough, because some older Clash interfaces can import profiles but do not contain a TUN implementation. Open the client’s About, Core, or Version panel and look for a Mihomo or Clash Meta core version. If the client has a core selector, choose the current compatible core rather than an obsolete legacy binary.
Next, make a backup of the active profile and note the current behavior. Test a normal website, an internal service, and a command such as curl https://example.com before changing anything. This gives you a baseline. If the connection is already failing because the subscription is expired, the selected proxy is offline, or the YAML file is invalid, TUN mode will not fix the underlying problem.
Your profile should contain a valid proxy group and a final fallback rule. A minimal structure may look like this:
mixed-port: 7890
mode: rule
log-level: info
tun:
enable: true
stack: mixed
auto-route: true
auto-detect-interface: true
dns:
enable: true
enhanced-mode: fake-ip
nameserver:
- 1.1.1.1
- 8.8.8.8
rules:
- DOMAIN-SUFFIX,example.com,Proxy
- GEOIP,LAN,DIRECT
- MATCH,Proxy
Do not copy this example blindly into a production profile. The name Proxy must match an existing proxy group, and your provider may already define DNS, rules, or TUN settings elsewhere. Duplicate top-level keys can be especially confusing: YAML parsers may accept the file while silently using only the last occurrence. If you edit the profile manually, keep one authoritative tun: block and one authoritative dns: block.
Check for conflicting network tools
Temporarily identify other software that installs virtual adapters or intercepts traffic. Common examples include another VPN client, a corporate security agent, Wintun-based tools, virtualization software, and older proxy clients configured for transparent interception. These tools do not always conflict, but two systems trying to become the default route can produce unstable results. If you need a company VPN for internal resources, plan the order carefully instead of assuming that both tunnels will cooperate automatically.
Also decide whether local devices must remain reachable. Printers, NAS devices, router administration pages, and smart-home equipment usually belong on a direct LAN path. Mihomo’s GEOIP,LAN,DIRECT rule is a useful starting point, but verify your actual private ranges and any custom domain names used by local services. TUN mode should not turn a simple printer job into a trip through a remote proxy.
3. Enable TUN and grant Windows permission
Open the client’s Settings page and locate the TUN, Service Mode, or System Integration section. In some clients, TUN is under General settings; in others, it is grouped with the core or DNS options. Turn on the feature, select the recommended network stack, and enable automatic route detection if the client provides it. The first activation may trigger a Windows User Account Control prompt. Approve it only when the request clearly belongs to the Clash client you installed from a trusted source.
The permission model varies. Some applications install a service that can create the virtual adapter after Windows starts. Others ask you to run the client as administrator. If TUN remains disabled after you approve UAC, fully exit the client, reopen it with Run as administrator, and check whether a Service Mode installation or service registration step is required. Avoid repeatedly clicking the toggle without reading the status message; this can leave a half-created adapter or a stopped helper service.
A typical activation sequence is:
- Save or reload the profile after confirming that it parses successfully.
- Open the client’s TUN settings and enable the TUN switch.
- Choose
mixedor the client’s recommended stack for the first test. - Enable automatic route and interface detection unless your network requires a manual interface.
- Accept the Windows permission prompt and wait for the status to become running.
- Restart the client only if the interface or service does not appear after a reasonable wait.
The mixed stack is often a practical beginner choice because it can use the Windows-compatible mechanisms available in the selected core. A system stack may behave differently depending on the core build and operating system. If the client documents a required driver or kernel component, install that component through the client’s own settings rather than downloading a random driver package from a forum.
After activation, open Windows Settings and search for View network connections. You may see a new adapter associated with Wintun, Mihomo, or the client’s service. The exact name is not important as long as it appears when TUN is running and disappears or becomes inactive when TUN is stopped. In PowerShell, you can inspect interfaces with:
Get-NetAdapter
Get-NetIPConfiguration
Get-NetRoute -AddressFamily IPv4
Do not manually delete the adapter while the client is running. If an old adapter remains after an uninstall, close all related proxy processes first, then remove it through the client’s cleanup option or Windows device management tools. Manual deletion is a last resort because a shared driver may be used by another legitimate network tool.
4. Configure routing and DNS safely
A working TUN interface does not automatically mean that every connection uses the desired proxy. Routing mode still decides what happens after traffic enters Mihomo. In Rule mode, domain and IP rules determine whether a request goes to a proxy group, stays direct, or is rejected. In Global mode, most traffic goes through the selected group, which can be useful for a short diagnostic test but is rarely the best permanent arrangement for a Windows workstation.
Begin with explicit local-network rules. Keep private address ranges and local hostnames direct so that router pages, printers, and file shares remain usable. Then add focused rules for the services that need the proxy. Put specific rules above broad rules: a domain rule placed after MATCH,DIRECT will never be reached. Similarly, a country-wide or catch-all rule can override the carefully chosen service rule if it appears too early.
DNS deserves equal attention. With TUN active, DNS requests may be captured and processed by Mihomo. Fake-IP mode can improve rule-based routing, but some Windows software expects a real address, and certain local services do not behave well with synthetic responses. Redir-host mode is often easier to troubleshoot because applications receive ordinary resolved addresses, although it may provide less control for some routing designs.
If sign-in pages loop, certificates appear inconsistent, or one application resolves a host differently from another, temporarily simplify DNS. Test with a conservative configuration, verify that the nameserver is reachable, and check the client’s DNS logs. Do not solve a DNS symptom by adding a large collection of random host rules. First determine whether the failure comes from resolution, route selection, TLS, or the remote node.
Protect direct traffic and avoid loops
Automatic route insertion is convenient, but it can capture traffic that should reach the local gateway directly. This is why LAN exclusions and interface detection matter. If you use a company VPN, examine which routes it installs before enabling TUN. A corporate subnet that is accidentally sent to a consumer proxy may become unreachable, while a proxy endpoint routed back into the same virtual interface can create a loop.
Keep the client’s own control panel reachable at its loopback address, normally something like 127.0.0.1. If a local API, development server, or Docker container cannot connect after TUN activation, test the loopback and private-address rules first. Some applications bind only to IPv4, while Windows may prefer IPv6; verify both stacks instead of assuming that a successful browser test covers every local service.
For applications that ignore system proxy settings, TUN should remove the need for individual proxy configuration. However, tools that already define HTTP_PROXY, HTTPS_PROXY, or ALL_PROXY can still behave differently. Clear stale environment variables during testing so you know whether the connection is using TUN or an application-level proxy.
5. Verify system traffic and troubleshoot failures
Verification should use several independent signals. First, open the client’s Connections or Logs panel and generate traffic from a browser, PowerShell, and one application that previously ignored the system proxy. You should see the destination host, the selected rule, and the proxy group or DIRECT decision. A TUN status badge alone is not sufficient proof; it confirms that the interface is enabled, not that the intended connection was routed correctly.
Second, compare external connectivity with TUN disabled and enabled. Use a reputable IP-checking service in a browser, then run a command-line request from PowerShell. A browser result can be misleading if it uses cached content, while a command can be misleading if it honors an old environment variable. Close and reopen the terminal after changing system settings, and use a fresh browser window when testing DNS or account redirects.
Third, inspect Windows routes and adapter state. If the virtual adapter is missing, focus on permission, service, or driver installation. If it exists but no connections appear in Clash, check auto-route, the selected physical interface, and whether another VPN owns the default route. If connections appear but are all rejected, inspect the profile’s proxy group names and final rule. If only selected domains fail, compare their DNS results and review the exact rule that matched.
- Internet stops working completely: disable TUN, confirm that the client itself can reach the proxy server, then re-enable TUN with a simpler profile and a known working node.
- Browser works but terminal fails: check shell proxy variables, terminal restart state, certificate requirements, and whether the command uses IPv6 or a separate runtime.
- Local devices disappear: add or correct LAN direct rules and verify the private network ranges used by your router and devices.
- DNS requests time out: test a simpler DNS mode, confirm nameserver reachability, and check whether a firewall or another VPN is intercepting port 53 or encrypted DNS.
- Some applications connect directly: confirm that TUN is running, automatic routing is enabled, and the application is not deliberately excluded by its own network sandbox.
- Websites load halfway: inspect blocked CDN, authentication, WebSocket, or API hostnames rather than changing the proxy node immediately.
When the setup is stable, export or record the working choices: client and core versions, TUN stack, DNS mode, route behavior, LAN exclusions, and any required Windows service. This runbook makes future upgrades safer. After updating the core, test the virtual adapter, DNS, local resources, and one proxied service again because defaults can change even when the YAML file looks identical.
Compared with many one-click VPN applications, which often expose only an all-or-nothing tunnel and provide little visibility into why a Windows program failed, Clash Meta gives you observable connections, ordered rules, selectable proxy groups, and separate controls for DNS and route insertion. That does mean more setup work, but the result is easier to audit: local printers can remain direct, a terminal can follow the same policy as a browser, and only the traffic that needs a relay has to use one. If you want that level of control across Windows applications, choosing a Mihomo-compatible client and applying the checks above is a practical next step.
Ready to get started?
Install a compatible Clash client and apply reliable TUN routing across your Windows applications.