How v2rayN TUN mode works and how to enable it: route traffic from apps that ignore the system proxy

Learn how TUN differs from the system proxy, what administrator permissions and settings v2rayN requires, common conflicts, and how to verify traffic routing.

At a glance

On Windows, if your browser connects through v2rayN but apps that ignore the system proxy still use the regular network, use TUN to capture their traffic, then check which outbound rule it matches. This guide uses the v2rayN 7.x Windows interface to walk through baseline checks, tests that rule out explicit proxies, and a recovery sequence for connection failures.

System proxy vs. TUN: different entry points, different routes

The system proxy gives apps that honor Windows proxy settings a local proxy address. An app that opens connections itself without a configured proxy may bypass this entry point. So if a website opens in your browser, that only confirms the browser's route works—not that command-line tools or other apps use the same route.

App opens a connectionSystem selects a routeTUN receives trafficRouting rules are matchedOutbound is selected

TUN creates a virtual network adapter and configures routes on the system. IP traffic routed to that adapter is then forwarded by the core handling TUN, according to its rules. Rules can send traffic through a proxy or directly. Some traffic may never enter TUN because of excluded subnets, routes from other virtual adapters, or address-family settings. Enabling TUN does not mean all traffic is forced through a proxy.

10808
Common local proxy ports used by v2rayN; check your actual settings
443
Remote TCP port used for the HTTPS test in this guide

How to verify: test the local proxy port and TUN path separately

A listening local port does not confirm that TUN is capturing traffic. For a useful test, clear the system proxy, make sure the test app uses no explicit proxy, then compare the virtual adapter, system routes, and outbound logs from the same time.

Enable v2rayN TUN mode on Windows

  1. Make sure your node works first. Select your usual node in the main window, leave TUN off, and visit a known-working HTTPS site using your normal system proxy setup. Note the node, routing profile, and system proxy status. If the baseline test fails, troubleshoot the node connection or local proxy listener first; enabling TUN won't rule out a node issue.
  2. Restart as administrator. Exit v2rayN from the system tray, then right-click the app or shortcut and select “Run as administrator.” Elevated permissions are needed to create the virtual adapter and change system routes. Closing the main window may leave the tray process running. On managed devices, check whether network configuration changes are allowed.
  3. Isolate the system proxy path. If you recorded the system proxy settings and can change them temporarily, select “Clear system proxy” from the system proxy menu at the bottom of the main window. “Do not change system proxy” preserves existing settings; it does not clear them. If the app has its own proxy address configured, disable that for the test too.
  4. Enable TUN and check the startup log. Select “Enable Tun mode” at the bottom of the main window. To review the parameters, open “Settings” → “Parameter settings” and find “Tun mode settings.” The control or tab name may vary by version. For the first test, keep the existing routing profile and default TUN settings; only toggle TUN. If the log reports a permissions, virtual adapter, or core startup error, fix the first error before proceeding.

Settings to compare for the first test

System proxy
Clear system proxy
Active node
Keep the node verified in the baseline test
Routing profile
Keep the setting used before enabling TUN
Tun mode
Enable, then check the log and routes

After clearing the system proxy, test once with TUN off, then repeat with it on.

Record these test details

Local proxy port
Actual value shown under “Settings” → “Parameter settings”
Virtual adapter
Record the interface name and index before and after toggling TUN
Address family
Test IPv4 first; test IPv6 separately if needed
Test target
Use the same domain, port, and request method

Change one variable at a time before adjusting DNS, routes, or other TUN settings.

Verify TUN routing: compare the request, adapter, and outbound

After clearing the system proxy, run the command below once with TUN off and once with it on. Use curl.exe to call the program explicitly; --noproxy "*" bypasses explicit proxies for this request, including any set through environment variables. -4 limits the test to IPv4, while --connect-timeout 5 caps the connection timeout at 5 seconds. The example domain is for a general connectivity check and may not match your proxy rules. To verify proxy routing, use an HTTPS target you're authorized to access that clearly matches a rule directing traffic through a proxy.

curl.exe --noproxy "*" -4 -I --connect-timeout 5 https://example.com/
Get-NetAdapter -IncludeHidden
Get-NetRoute -AddressFamily IPv4 | Format-Table DestinationPrefix, InterfaceIndex, RouteMetric
  • Check the request result first. An HTTP response means the HTTPS request reached a responding endpoint; it doesn't tell you which outbound route it used. Success both before and after enabling TUN is common: both requests may have gone direct, or the route may have changed while the response stayed the same.
  • Then check the adapter and routes. Compare ifIndex in the adapter list with InterfaceIndex in the routing table. Check whether any new or changed routes cover the test target. Don't look only for 0.0.0.0/0: a more specific destination prefix can also change the route. The adapter's presence alone doesn't prove the request used it.
  • Finally, check the outbound route. In the v2rayN log, match the request time and destination to the outbound label to distinguish proxy from direct connections. If the current log only records startup events or errors, temporarily enable the access log for the relevant core and run the test again, then turn it off afterward. Without per-connection records, don't infer the outbound route from the toggle state or webpage result alone.

If the affected app uses UDP or prefers IPv6, repeat the test in that app. The command above only checks one IPv4 HTTPS request; it doesn't verify UDP, IPv6, or the app's own DNS resolution path.

No connection, LAN issues, and recovery after enabling TUN

First determine whether all connections fail or only a particular domain, app, or subnet. If everything fails, turn off TUN and test the node again using your original proxy setup. If only some traffic fails, check the target's DNS, actual destination address, and matched routing rule first. Don't change the node, DNS, and routing profile all at once.

TUN turns itself off after I enable it. What should I check first?

Check the first startup error after toggling TUN. For a permissions error, fully exit v2rayN from the system tray and restart it as administrator. If the log reports that a local port is in use, run netstat -ano to find the process listening on that port, then check its PID in Task Manager. Don't terminate a process based on the port number alone.

Why can't I access a network drive or internal service while my work VPN is on?

Both virtual adapters may install routes or change DNS settings. Turn off v2rayN TUN while keeping the work VPN connected, then retry the same internal address. If it works again, check which route prefix and interface the destination actually matches. Leave organization-managed routes unchanged. If both VPNs must run together, confirm which destination subnets can be excluded, then configure and test them one at a time.

The virtual adapter is there. Why is the request still going direct?

First confirm the test app isn't using its own proxy, then compare the destination address with the routing table. If the request entered TUN, check whether the log shows a direct outbound and review any higher-priority matching rules. Adjust the target's match conditions only after confirming the wrong rule was selected, then rerun the same request.

The log says DNS resolution failed. What should I change first?

Run Resolve-DnsName example.com -Type A with TUN both on and off, then repeat with the domain that actually fails. If resolution only fails with TUN enabled, check the current DNS settings and the route to the DNS server. If the system query succeeds but the app still reports an error, check whether it has its own secure DNS enabled; a system query doesn't show which resolution path the app uses.

  1. Stop TUN routing: Turn off “Enable Tun mode,” check that the routes added earlier have disappeared, then retry the affected destination.
  2. Restore the original route: Restore the system proxy settings you recorded before enabling TUN. If an organization policy or script configured them, don't overwrite them with v2rayN's local proxy address.
  3. Keep troubleshooting details: If the issue persists, exit v2rayN normally from the system tray, then check the adapters and routes. Note the v2rayN version, first error, destination address family, and expected outbound route. Before sharing logs, remove node credentials and any addresses you don't want to disclose.

v2rayN Client Downloads & Setup Guide

Choose a package for your operating system and processor architecture. For your first setup, verify the node and system proxy before enabling TUN for a comparison test.

Client downloads