1. Understanding TUN Mode: Why System Proxy Isn't Enough
In the world of proxy clients, the "System Proxy" toggle is often the first thing users touch. However, it relies on applications voluntarily looking at the operating system's proxy settings. Many modern software stacks—including Node.js runtimes, Go binaries, Docker containers, and AAA games—completely ignore these settings, connecting directly to the internet and bypassing your Clash rules.
TUN Mode (Terminal User Network) solves this by creating a Virtual Network Adapter at the kernel level. Instead of waiting for apps to "opt-in" to a proxy, the OS treats Clash as a physical network card. By modifying the system routing table, all outbound IP packets are "forced" through this virtual interface, where the Mihomo core can then apply DNS resolution and rule-based routing. This is the closest you can get to a hardware-level VPN experience using a software proxy client.
2. Pre-requisites and Driver Installation
Before you can flip the switch on TUN mode, your operating system needs to recognize the virtual device. Depending on your choice of GUI (Clash Verge Rev, Mihomo Party, or Clash Nyanpasu), the driver installation process is usually integrated into the settings menu.
- Windows: Requires the
Wintundriver. Most clients will prompt you to install this. You must run the application as Administrator for the driver to initialize and for the routing table to be modified. - macOS: Uses the native
utundevice. While it doesn't require a separate driver, you must grant the app Root permissions (usually via a password prompt when enabling the service). - Linux: Requires
setcapto allow the binary to bind to privileged ports and manage network interfaces without running the entire GUI as root.
3. Configuring the YAML TUN Block
Even if your GUI has a "TUN Mode" button, the underlying config.yaml must be correctly configured to handle the traffic. A modern 2026-standard TUN configuration block looks like this:
tun:
enable: true
stack: system # Options: system, gvisor, mixed
dns-hierarchical-routing: true
auto-route: true
auto-detect-interface: true
mtu: 9000 # Jumbo frames can improve performance on high-speed fiber
strict-route: true # Prevents traffic leakage outside the TUN interface
Choosing the right Stack is critical. The system stack leverages the OS's native network stack, offering high performance but occasionally causing compatibility issues with certain VPNs. The gvisor stack implements a user-space network stack, which is more compatible and safer but slightly more CPU-intensive. For most users in 2026, system is the recommended default for 1Gbps+ environments.
4. Platform Guide: Windows 10/11
Windows users often face the "Loopback" issue, where UWP apps (like the Microsoft Store or Xbox App) cannot connect to local proxies. TUN mode bypasses this limitation entirely.
To enable it in Clash Verge Rev:
- Go to Settings -> Clash Core Service.
- Click Service Mode and install the service. This allows Clash to stay active even when the GUI is closed and provides the necessary permissions for TUN.
- Back in the Dashboard, toggle TUN Mode to ON.
- Open
cmdand typeipconfig. You should see a "Clash" or "Wintun" adapter with an IP like192.168.123.1.
5. Platform Guide: macOS (Intel & Silicon)
On macOS, TUN mode is particularly useful for Terminal (zsh/bash) and Homebrew, which notoriously ignore system proxy settings unless http_proxy variables are manually exported.
When you enable TUN mode on macOS, Clash will create a utun interface. If you encounter a "Permission Denied" error, ensure that you have moved the application to the /Applications folder and that you have authorized the "Helper Tool" installation. In 2026, with macOS Sequoia and later, you may also need to check System Settings -> Network -> Filters to ensure Clash isn't being blocked by another security product.
6. Platform Guide: Linux Desktop & Headless
Linux users generally prefer the nftables or iptables approach, but Clash's TUN mode simplifies this significantly. To use TUN mode on Linux without running as root, apply the following capabilities to your Mihomo binary:
sudo setcap cap_net_admin,cap_net_bind_service=+ep /path/to/mihomo
This allows the process to manage the routing table (cap_net_admin) while maintaining a secure, non-root user profile. In your configuration, ensure auto-route is set to true so Clash can automatically handle the ip route commands for you.
7. DNS Strategy: The Key to Successful TUN Routing
TUN mode is only as good as your DNS configuration. If your DNS leaks (i.e., your computer uses the ISP's DNS instead of Clash's), the routing rules won't know where to send the packets. You must use Fake-IP or Real-IP (mapping) within Clash.
In 2026, the Fake-IP mode is the standard for TUN users. It allows Clash to immediately return a "fake" internal IP address to the application, allowing Clash to resolve the actual destination IP on the remote proxy server. This prevents DNS poisoning and drastically speeds up the initial connection phase.
8. Troubleshooting Common TUN Failures
Symptom: No Internet after enabling TUN.
Check if strict-route is enabled. If Clash crashes while this is on, your system might lose routing to the physical gateway. Try disabling strict-route or ensuring the Clash service is set to auto-restart.
Symptom: High CPU usage.
This is often caused by a "routing loop." Ensure that your proxy server's IP address is excluded from the TUN interface (usually handled by auto-detect-interface), otherwise, Clash will try to proxy the proxy connection itself, creating an infinite loop.
9. Why Clash TUN Wins Over Traditional VPNs
Traditional VPNs are "dumb" pipes—they send everything through one tunnel. If you are a developer, you don't want your local git push to an internal server or your 4K video stream to a domestic site to go through an overseas proxy.
Compared to the clunky experience of switching VPNs on and off, Clash TUN Mode offers a "set and forget" solution. It provides the system-wide capture of a VPN with the surgical precision of Clash's rule engine. Whether you are debugging a go get timeout in your terminal or trying to reduce latency in an international game, TUN mode provides the infrastructure to handle it all without manual proxy environment variables.
If you are tired of applications "leaking" through your proxy or the constant headache of configuring export https_proxy=... in every shell session, moving to a TUN-based workflow is the single best upgrade you can make to your network environment.
Ready to upgrade your network? Download the latest Clash clients now →
Ready to get started?
Download Mihomo-compatible clients for Windows, macOS, and Linux to experience full system-level proxying with TUN mode.