Traffic coverage: system proxy, TUN, and global mode
A system proxy provides applications with a proxy address through the operating system. For example, if the client's mixed listener is set to 7890, an application that supports HTTP proxies can connect to 127.0.0.1:7890, and the client handles the request from there. Check the port shown on your device. Apps that create their own network connections may ignore the system proxy, while command-line tools may use environment variables or their own settings instead.
TUN receives packets at the IP layer when the operating system routes them to a virtual network adapter. Applications connect to their destination directly, without configuring a local proxy port. The kernel then routes each packet directly, through a proxy, or blocks it according to the rules. TUN can cover more TCP and UDP applications, but actual coverage still depends on the routing table, address families, exclusions, and platform limitations. Proxying UDP also requires UDP support from the selected node and protocol.
| Setting | Where it applies | What to check |
|---|---|---|
| System proxy | Provides applications with a local proxy address | Whether the application uses that address and port |
| TUN | Receives IP traffic selected by routing through a virtual network adapter | Whether the destination connection appears in the client's connections panel |
| Global mode | Selects a global policy for traffic that has reached the kernel | Which outbound route is selected by the global policy group |
Virtual network adapters, automatic routing, and DNS interception
Routing determines where packets enter
When TUN is enabled, the client or kernel first creates a virtual interface, then adds routes that direct the target traffic to it. Connections from the kernel to proxy nodes, or direct connections, still need to leave through a physical network adapter. If outbound traffic is mistakenly routed back through the virtual interface, the toggle may appear enabled while all connections time out. If the problem starts after switching from Wi-Fi to Ethernet, first check whether the outbound interface follows the updated default route; don't start by changing nodes or rules.
DNS interception determines who answers regular queries
mihomo's dns-hijack hands eligible DNS requests that enter TUN to its built-in DNS module. The tun section below should be merged into an existing mihomo configuration; it is not a standalone subscription. Before using it, confirm that dns.enable is enabled in the effective configuration and that reachable upstream DNS servers are configured. If the existing configuration already has a tun section, update the relevant fields instead of adding a second top-level key with the same name.
tun:
enable: true
stack: mixed
auto-route: true
auto-detect-interface: true
dns-hijack:
- "any:53"
- "tcp://any:53"
stack: mixedselects a mixed protocol stack for TUN. It is separate frommixed-port; changing the protocol stack does not change the local proxy port.auto-routeconfigures routes for traffic interception;auto-detect-interfacedetects the outbound interface automatically. In a multi-uplink setup, check these two options separately.any:53andtcp://any:53match UDP and TCP DNS queries on port 53 that enter TUN, respectively. They do not match browser DoH requests sent over HTTPS on port 443, or queries sent to a loopback interface that never enter TUN.
GUI clients may merge subscriptions, overrides, and UI settings at startup. For troubleshooting, inspect the effective configuration: seeing enable: true in a subscription file does not prove the client hasn't overridden it at startup. On corporate networks, preserve the appropriate DNS resolution path for internal domains instead of sending all internal queries to a public resolver.
Enable TUN on Windows, macOS, and Linux
Windows and macOS: Clash Verge Rev 2.x
- Select a configuration on the “Profiles” page, then choose rule mode and an available node on the “Proxies” page. First make sure the selected configuration loads correctly so you can distinguish a node issue from a network adapter issue.
- Go to “Settings” → “System Settings” and find “TUN Mode.” If the toggle prompts you to install or start a service, use the “Service Mode” option in the same section. Some 2.x builds place it beside the TUN toggle. Windows displays an administrator authorization prompt; macOS may ask for administrator credentials.
- Turn on “TUN Mode” and temporarily turn off “System Proxy.” Create a new connection in an app, then check the destination, matched rule, and outbound policy on the “Connections” page. If the test app has its own proxy configured, temporarily clear that setting too, so the request doesn't still enter through the local proxy port.
If Wintun initialization fails on Windows, check the logs to see whether access was denied, driver initialization failed, or an interface with the same name already exists. On macOS, use ifconfig to inspect utun interfaces, but system services and other VPNs can create them too, so the interface name alone doesn't identify its owner. On both platforms, compare interface changes with the time you enabled TUN, client logs, and records of newly created connections.
Linux: device nodes and service permissions
On Linux, the process running mihomo needs access to /dev/net/tun. Creating interfaces and setting routes usually also requires CAP_NET_ADMIN. Having a graphical interface installed does not mean the kernel process has these permissions. Prefer the service mode provided by your distribution's package. If you run mihomo as a standalone core, have a managed service process load the configuration rather than running the entire desktop client as root.
ls -l /dev/net/tun
ip -br link
ip rule show
ip route show table all
If the device node is missing, check whether the system provides TUN support. In a container, the device may exist on the host but still be unavailable inside the container; confirm that the runtime grants device access and the required network permissions. TUN in a container usually captures traffic only within its own network namespace. When troubleshooting routes, check policy rules and other routing tables too; looking only at the main routing table may miss interception rules installed by the kernel.
Android and iOS: system-authorized VPN interfaces
Android clients typically create a virtual interface through the system's VpnService. For example, in Clash Meta for Android, select a configuration and start the client from the home screen. The first time it connects, approve the system “Connection request.” On stock Android, check the connection under “Settings” → “Network & internet” → “VPN.” If the client is configured to include or exclude specific apps, only apps within its scope use the VPN route; make sure the app you're testing hasn't been excluded.
On iOS, using Stash as an example, import a configuration supported by the app, start it, and approve the system prompt to “Add VPN Configuration.” Check the status under “Settings” → “General” → “VPN & Device Management” → “VPN.” The interface is managed by the system's Network Extension and does not use desktop service mode. Compatibility with rules does not mean every mihomo YAML field is supported.
Troubleshooting: adapter present but no internet, no app connections, UDP timeouts
Use the same request to test proxy and routing paths separately
The examples use 7890 as the mixed port, and --max-time 8 limits each request to 8 seconds. Run the first command with both the system proxy and TUN disabled; it tests the local listener and outbound connection through an explicit proxy. Run the second with only TUN enabled; --noproxy "*" prevents curl from using proxy settings it may have read. In Windows PowerShell, use curl.exe.
curl --max-time 8 --proxy http://127.0.0.1:7890 -I https://example.com/
curl --max-time 8 --noproxy "*" -I https://example.com/
An HTTP response to the second request proves only that the destination is reachable. Also check the connections panel while the request is running and confirm that the destination domain or IP appears, showing that the request actually entered TUN. If the panel shows only active connections, the entry may disappear as soon as the request ends; check the client logs instead. These tests use TCP and do not replace testing UDP traffic such as voice chat, games, or QUIC.
| Symptom | What to check first |
|---|---|
| Toggle switches off immediately; logs show a permission error | Confirm the service is running and the account has permission, then check the first error during virtual interface creation. |
| Local proxy works, but requests time out with TUN enabled | Check the default outbound interface, routes from other VPNs, and DNS timeout logs. Change one setting at a time, then rerun the same request. |
| Browser works, but a specific app has no connection records | Check the app exclusion list, routes for the destination network, and IPv6 coverage. If the destination uses IPv6, a successful IPv4 test does not prove that connection was captured. |
| Web pages load, but voice chat or games time out | Check for UDP entries in the connections panel, then inspect the matched rule, the node's UDP support, and any network restrictions imposed by the app. |
| Printer or internal domain stops working after TUN is enabled | If an internal IP is reachable but its domain name fails, check internal DNS first. If the IP is also unreachable, check LAN routes and rules, then see whether the app relies on local multicast discovery. |
To restore network access, turn off TUN first and retry the same destination. If it is still unreachable, check whether the system proxy points to a local port that is no longer listening and whether the default route has returned to the expected physical adapter or corporate VPN. Adjust interception settings only when the failure consistently tracks the TUN toggle. Avoid changing DNS, the protocol stack, and subscription rules at the same time.