How to Enable TUN Mode in v2rayN: Route All Traffic Through a Virtual Network Adapter

Compare system proxy and TUN mode, learn how a virtual adapter captures traffic from apps that ignore proxy settings, and follow setup and permission troubleshooting steps.

At a glance

If your browser connects but games or command-line tools still connect directly, check whether those apps follow the system proxy before enabling TUN. This guide covers the Windows desktop version of v2rayN, from permissions and virtual adapter setup to route verification and recovery. First distinguish traffic capture from proxying all traffic, then verify the configuration with logs and system commands—not just an enabled toggle.

System proxy, TUN, and global routing: what's the difference?

A system proxy registers a proxy address with the operating system, and apps that support the setting connect to a local proxy endpoint. It does not automatically change how every program handles network traffic: some command-line tools use environment variables, some games open sockets directly, and some apps have their own proxy settings. A working browser connection only confirms that the browser's route is working.

TUN provides a virtual network adapter at the network layer. Combined with routing, it sends matching IP traffic into a processing chain. Apps do not need to understand HTTP or SOCKS proxies, but whether traffic is captured still depends on routes, interface binding, address family, and exclusions. Once captured, rules determine whether it connects directly, uses a proxy, or is blocked.

SettingWhere it worksWhat it does not guarantee
System proxyConnects apps that support the setting to a local proxy portDoes not guarantee capture of games, UDP, or all command-line requests
TUN modeReceives IP traffic through a virtual network adapter and system routesDoes not guarantee that all traffic exits through a remote server
Global proxy routingSends requests allowed by the rules to a proxy outboundDoes not replace TUN or fix an unavailable server
Rule-based routingSelects different outbounds based on domains, IP addresses, and other conditionsDoes not guarantee that all mainland China or local network addresses are covered by the rules

In short: choose how to capture traffic, then choose the outbound rules

For browser-only proxying, start with the system proxy. To handle apps that ignore proxy settings, try TUN. If those apps also need to use a server's exit IP, check the active routing policy—enabling TUN alone does not mean all traffic is proxied.

Prepare permissions, a working server, and a fallback

First confirm that the selected server works in system proxy mode, then add TUN. VMess and VLESS are protocols used by servers; subscription URLs provide and update server configurations. Neither creates a virtual network adapter. If the server is unavailable, changing traffic capture methods only adds more variables to troubleshoot.

v2rayN is a graphical client that manages connections; the core it calls handles traffic processing. TUN implementations and core combinations can vary between versions, and common setups may involve sing-box. Do not assume that because a server uses Xray, TUN must be handled independently by the same core. When troubleshooting, rely on the process, configuration, and errors shown in the startup logs.

Enable v2rayN TUN mode step by step

These steps use the commonly seen Chinese desktop interface. Labels may move between v2rayN releases; if you see names such as “Tun mode settings” or “TUN settings,” check your version's documentation. A missing label is not a reason to create a network adapter manually.

  1. Verify the server

    Select an existing server on the main screen and set it as the active server. With the system proxy enabled, try opening a known-working HTTPS site. If that fails, troubleshoot the server address, port, authentication, and device clock first.

  2. Run with elevated permissions

    Exit v2rayN completely from the system tray. Then right-click the program, select “Run as administrator,” and approve the system prompt. Closing only the window and reopening the app may leave the old, non-elevated process running.

  3. Check the settings

    Open “Settings” → “Parameter settings” and review the local listener configuration. If your version has the tab, open “Tun mode settings.” For your first test, keep the client's defaults; do not change the protocol stack, MTU, and DNS policy all at once.

  4. Choose a route

    Check the routing selector at the bottom of the main window. For everyday use, start with an existing split-routing preset. To compare exit routes, temporarily use a global proxy preset and note the original selection so you can restore it.

  5. Enable traffic capture

    Turn on “Enable Tun” at the bottom of the main window, then check the logs for adapter creation, interface startup, and route errors. To test TUN by itself, switch “System proxy” to “Clear system proxy” so the browser does not keep using its previous route and skew the results.

  6. Check the apps

    Test a browser first, then test a target program that did not previously use the system proxy. Check the destination and actual outbound in the logs. If the network goes down, turn off “Enable Tun” first, then restore the previous system proxy setting.

“Clear system proxy” helps reduce variables during testing; it does not mean the two features can never be used together. Once the setup is stable, decide whether to keep the system proxy based on your apps. Make sure the core's own outbound connection is not routed back through the proxy endpoint, or you may create a connection loop.

Verify traffic capture with ports, routes, and logs

These three numbers are common troubleshooting reference points, not settings to copy blindly. In particular, use the actual listening port shown under “Settings” → “Parameter settings.” If the example port 10808 differs from yours, replace it with your configured port.

10808
Example local proxy listening port
53
Common port for traditional DNS
443
Common HTTPS destination port

Run these read-only commands in PowerShell to compare interfaces and routes before and after enabling TUN. TUN may capture traffic with more specific routes without replacing the existing default route, so checking only whether the default gateway changed is not enough. A listening port confirms that an endpoint started, but does not prove the server is working.

# View network interfaces and compare changes before and after enabling TUN
Get-NetAdapter -IncludeHidden

# View IPv4 and IPv6 routes
route print -4
route print -6

# Use only if the local listening port is 10808
Get-NetTCPConnection -State Listen -LocalPort 10808

# Ignore user curl settings and do not use an explicit HTTP/SOCKS proxy
curl.exe -q --noproxy "*" --connect-timeout 10 -I https://example.com

The last command can help test a request that does not explicitly use an application-layer proxy. Run it once with TUN off and once with TUN on, while checking the client logs. An HTTP response means the connection to that destination made progress, but does not prove it used a proxy: the site may be reachable directly. Also check the selected outbound in the logs.

Troubleshoot DNS, UDP, and local network access

TUN receiving packets does not guarantee that domain names resolve correctly. Traditional DNS often uses UDP or TCP port 53, but browsers may also use encrypted DNS. If domains fail while existing connections keep working, check the DNS path before switching all your servers.

Under “Settings” → “Parameter settings,” check the DNS-related tabs available in your version and distinguish between direct resolution, proxy resolution, and TUN DNS handling. Domain policies need to work with routing rules. Sending all DNS queries to a resolver that is currently unreachable can cause both direct and proxied connections to time out.

SymptomCheck firstWhat to do
Domain connection failsDNS reachability, resolution path, and logsRun Resolve-DnsName example.com and check the logs; change one DNS setting at a time before retrying
Web pages work, but voice calls failUDP support, the server, and firewall rulesCheck the target app's UDP connection logs and confirm that the server and transport path support forwarding
Printer or shared resource is unreachableWhether local network traffic is being routed through the proxyCheck that the route sends your actual local subnet directly, and review the local firewall
Some destinations still connect directlyIPv6 routes, app interface binding, and rule exclusionsCompare IPv4 and IPv6 route tables, then check which rule actually matched the destination

Troubleshoot startup failures and restore your network

Troubleshoot in this order: permissions and interface → core startup → server connection → DNS and routing. The first clear error in the logs is usually more useful than the timeouts that follow. Before sharing logs, redact subscription URLs, server authentication details, and other sensitive information.

TUN reports insufficient permissions. What should I do?

Exit the client from the system tray, then start it with “Run as administrator.” If it still fails, check whether security software or your organization's policies are blocking virtual interface creation or route changes. Do not disable all security protection just to test.

The toggle is on, but the logs say core startup failed. Why?

Check that the program folder is complete and review the first core startup error. If an address or port is already in use, run Get-NetTCPConnection -State Listen to identify the process; do not terminate an unfamiliar system process.

All web pages time out after enabling TUN. What should I change first?

Turn off TUN, restore the original system proxy, and test the same server. If the original mode fails too, troubleshoot the server first. If only TUN fails, check for route conflicts and DNS issues. Keep the default protocol stack as your baseline and change one option at a time.

The network is still down after I exit the client. What should I do?

If the program exited unexpectedly, restart it with the same permissions, turn off TUN, then select “Clear system proxy” and exit normally. If the network still does not recover, restart the computer and check Windows proxy settings and network connectivity. Do not run commands that flush all routes.

After testing, restore the split-routing preset that suits your everyday use, then test local network access, your browser, and the target app again. If the system proxy meets your needs, leave TUN off and enable it only when needed. Keeping a verified configuration makes issues easier to pinpoint than repeatedly changing the MTU, DNS, protocol stack, and routes.

Download V2Ray clients