· Getting Started · 8-minute read
Clash First-Run Setup: System Proxy, TUN Mode, and Port Conflicts
A practical first-run checklist for Clash on every platform: permissions, system proxy settings, TUN setup, and port conflicts, with common causes and fixes.
Select a Configuration Before Enabling the Proxy
Seeing a subscription in the profile list only confirms that it was imported. Select the profile you just added and make sure it is the active one, then check the runtime log for configuration parsing or listener errors. For your first desktop test, turn off the system proxy and TUN, and note the local listening port shown by the client. That way, you won't mistake an old port for the current setting later.
- Check the mode. Start in Rule mode to verify how traffic is routed. If a rule matches
DIRECT, that connection is going direct according to the configuration. A page loading successfully doesn't tell you whether it went through the proxy. - Check the selected proxy group. When testing a site that requires a proxy, choose a known working node in the proxy group first. Open the site, then check its domain, matched rule, and outbound connection in the client's connection list. If the browser reuses a connection, close that tab and reopen it; if needed, restart the browser and try again.
- Enable only one traffic-capture method at a time. On desktop, test the browser with the system proxy first. Try TUN only if the target app ignores system proxy settings and can't easily be configured to use a proxy directly. This makes it easier to tell whether the local proxy failed to start or traffic never reached the client.
Enable the System Proxy and Check the Address and Port
The system proxy directs apps that honor system proxy settings to a local proxy port. It doesn't automatically capture traffic from every process. For example, with a mixed port of 7897, a manual HTTP proxy is usually set to 127.0.0.1:7897 when the core and client run on the same computer. This is only an example; use the port in your current configuration. If HTTP and SOCKS use separate listeners, don't enter socks-port in the system's HTTP proxy field.
| System | Where to check | What to check |
|---|---|---|
| Windows 11 | Settings → Network & internet → Proxy → Manual proxy setup | Check the proxy server address and port. If you normally use a proxy script provided by your organization, note the existing settings before changing anything. |
| macOS 15 | System Settings → Network → Select the current network service (such as Wi-Fi) → Details → Proxies | Check the server and port for Web Proxy (HTTP) and Secure Web Proxy (HTTPS). If you switch to a wired connection, check the settings for that network service too. |
| Linux(Ubuntu 24.04 GNOME) | Settings → Network → Network Proxy | Desktop proxy settings are separate from shell environment variables. Check each terminal tool and background service individually to see whether it uses a proxy. |
Test the Local Proxy with a Single Request
If you're not sure whether the system setting failed to apply or the proxy port itself is unavailable, use curl with an explicitly specified HTTP proxy. In Windows PowerShell, use curl.exe; replace 7897 in the command with your actual HTTP or mixed port. The command works whether or not the client has enabled the system proxy, and it doesn't change system settings.
curl -v --max-time 15 --proxy http://127.0.0.1:7897 --noproxy "" https://clash-sub.com/
- Connection to the local port is refused: Check that the core is still running and that the listening port in the log matches the one in the command.
- The local connection works, but the HTTPS request fails: Check the request's matched rule and outbound connection in the logs. A connection to the local port only confirms that the proxy listener responds; it doesn't mean the upstream or destination is reachable.
- The command succeeds, but there's no matching browser connection: Check whether the browser uses system settings, whether an extension controls its proxy, and whether the destination domain is on a bypass list. The command alone can't confirm that a particular node was used; check the matched rule as well.
Use TUN for Apps That Ignore System Proxy Settings
TUN routes traffic to the core through a virtual network interface and routing rules. Once traffic enters TUN, the configuration still determines whether it goes direct or through a proxy; enabling TUN doesn't switch to Global mode. For testing, turn off the system proxy first. Otherwise, the browser may connect through a different route and make it look as though TUN is working.
Desktop: Install the Service or Grant Permissions, Then Check Routing
- Windows: For example, in Clash Verge Rev 2.x with the mihomo core, look in the client settings for Service Mode or the service installation option. The exact location may vary between minor versions. Follow the prompts to grant administrator privileges, confirm the service is running, and then enable TUN. A running service only confirms that the privileged component is available; check the client logs and actual connections to verify that TUN is working.
- macOS: If the client manages TUN through a privileged helper, install and authorize it as prompted by the client. You don't need to manually enter an HTTP proxy just to enable TUN. If a problem occurs only after switching Wi-Fi networks or waking from sleep, check the client log to see whether the interface and routes were re-established.
- Linux: If you run mihomo directly, check that
/dev/net/tunis available in the current environment and that the service process has permission to configure interfaces and routes, typically throughCAP_NET_ADMIN. For a GUI client, use its service installation option. If you run into a permissions error, check the service log first; loosening file permissions won't grant network privileges.
Mobile: Check System VPN Authorization
On Android, a client using VpnService prompts for system VPN authorization the first time it connects. If you cancel, the subscription may still appear imported, but traffic won't enter the VPN. If the connection drops right after authorization, search for “VPN” in Settings and check whether another VPN is connected or always-on VPN is enabled. Don't change management policies on a work-managed device. On iOS, clients that route traffic through the system VPN usually ask to add a VPN configuration. Check the active connection under Settings → General → VPN & Device Management → VPN. Desktop service installation steps don't apply to phones.
If you can no longer reach your work network or local devices only when TUN is on, turn TUN off first and check whether the original connection comes back. Then compare the route ranges and DNS settings for the original VPN and TUN, along with their local network subnets. If hostnames fail but private IP addresses work, check DNS first. If both fail, check routes or overlapping subnets. Switching to Global mode won't resolve a routing conflict.
Port Already in Use? Find the Process, Then Change the Right Setting
If an old client, background service, or another program is already listening on the same address and port for the same protocol, the new core may fail to bind. Note the port reported in the startup log. The example below uses 7897 and checks TCP listeners; if the log specifically reports UDP, check UDP on the relevant system instead.
| System | Command | What to check |
|---|---|---|
| Windows PowerShell | Get-NetTCPConnection -LocalPort 7897 -State Listen | Note OwningProcess, then find the matching PID in the Task Manager's Details tab. |
| macOS | lsof -nP -iTCP:7897 -sTCP:LISTEN | Check COMMAND and PID to see whether the process is an old client still running in the background. |
| Linux | ss -ltnp 'sport = :7897' | Check the listening address first, then the process details. If you don't have sufficient permissions, only the listener may be shown. |
- If an old client is using the port: Quit it completely from the system tray or menu bar. If the old core is managed by a service, stop that service as described by the client. Closing the window may not stop the process. Check the owner of any unfamiliar process before taking action; don't terminate it blindly.
- If the process using the port needs to keep running: Choose an unused port—for example, check
7898first. If the conflict is withmixed-port, change the mixed port in the client's port settings or persistent overrides. Editing the YAML generated by a remote subscription directly may be undone the next time it updates. - Update all proxy entry points after reloading. Confirm that the core is listening on the new port, then check the system proxy and any proxy addresses entered in apps. Turn the client's system proxy off and back on, and verify that the new settings were applied. If the log reports an error for
external-controller, change the controller interface—not the mixed port. Update the dashboard address accordingly, and keep the controller listening on a loopback address for local use.
Check Again After Quitting, Restarting, or Updating a Subscription
A first-run check isn't complete just because one web page loads. Turn off the system proxy or TUN in the client, then quit normally and confirm that the system has returned to its pre-install proxy settings. If your connection drops after quitting, check whether the system still points to a local port that's no longer listening. If you were using an organizational proxy, restore its settings rather than simply turning the proxy off.
- Restart the client: Confirm that the correct profile is still active and the core is listening on the expected port. Enable only the traffic-capture method you need, then test the same site or app again.
- Update the subscription once manually: Check that port overrides are still in place and that your usual proxy groups still point to available nodes. If the remote update changed group or node names, select them again.
- Enable startup options last: Check “Launch client at startup” separately from “Enable system proxy or TUN on launch.” Starting the client when you sign in doesn't mean it will automatically route traffic through the proxy.