How to Enable TUN Mode in v2rayN: Virtual Adapter Routing Explained

Learn how TUN mode differs from the system proxy, how a virtual adapter captures traffic from apps that ignore proxy settings, and how to enable TUN in v2rayN and resolve common conflicts.

At a glance

If your browser works through the proxy but another desktop app still connects directly using system routing, compare the results with v2rayN's TUN mode on Windows. Start with your current server as a baseline, switch how traffic is captured, then check the virtual adapter, outbound rules, and DNS. This guide also covers what to do if you lose connectivity, a printer goes offline, or the network still does not work after TUN is disabled.

1. Where the system proxy and TUN intercept connections

A system proxy provides a proxy address before an app connects. Apps that use system settings send requests to the local proxy listening port; apps that open connections themselves without reading those settings continue to use the operating system's routing. A browser reaching a site through the system proxy only confirms that this proxy path works for the browser—not that other apps use it too.

App sends trafficSystem routingVirtual adapterRule matchingOutbound connection

TUN operates at the IP layer, receiving packets that system routing sends to the virtual adapter. Apps do not need to know the local proxy port, and the core can process connections according to its configuration. “Capturing all traffic” describes the scope of traffic routed into TUN, not a guarantee that every connection uses the proxy: traffic that never enters the virtual adapter follows its original path, while captured traffic may still match a direct-connection rule. UDP also depends on the outbound configuration, server, and destination service, so a webpage loading is not proof that UDP works.

System proxy

What must be true
The app must use the system proxy settings
Where to configure it
“System Proxy” at the bottom of the main window
Example listening address
Local address: 127.0.0.1:10808; the actual port depends on the client configuration

When troubleshooting, first confirm that the app reads the proxy settings, then check that the listening protocol and port match.

TUN mode

What must be true
System routing sends packets to the virtual adapter
Where to configure it
“Enable TUN” at the bottom of the main window
Outbound behavior
Depends on the routing rules and the active core configuration

Apps do not need a local proxy port configured; check the adapter, routes, and outbound logs when troubleshooting.

Test with an app that ignores system proxy settings

If the app that needs connectivity already works through the system proxy, keep the current mode. Test TUN only if the target app still ignores proxy settings on the same server and network.

2. Enable v2rayN TUN mode on Windows

These steps use the v2rayN 7.x Windows desktop interface as an example. Button labels and settings locations may vary between minor versions. Test with an existing, working configuration, and do not change the subscription, server, and routing rules at the same time. Otherwise, if TUN fails, it will be difficult to tell whether the server was already unavailable or the routing change caused the problem.

  1. Establish a baseline. Select a known working entry in the list, then set it as the active server from the right-click menu. Leave TUN off and use the system proxy to access a known working HTTPS service. Then open the app you are troubleshooting and note whether it fails to resolve, times out while connecting, or has only a specific feature that fails.
  2. Remove duplicate proxy settings. Select “Clear System Proxy” under “System Proxy” at the bottom of the main window. This prevents browser tests from continuing to send requests through the local listener via the system proxy. If the target app has a proxy address entered manually, note the original value and temporarily disable that setting. Do not change proxy or network policies managed by your organization.
  3. Start the virtual adapter. Select “Enable TUN” at the bottom of the main window. If the client requests elevated permissions, follow the prompt to restart as an administrator. After restarting, confirm that the active server has not changed, then enable TUN. To review related parameters, open “Settings” and select “Parameter Settings” to see the TUN options available in your version. Keep the defaults for the initial test.
  4. Reconnect the app. Wait until the logs show that the core has started, then close and reopen the app under test and repeat the same request. Existing long-lived connections are not a reliable way to verify a routing change. If the app depends on UDP, test the relevant feature separately rather than assuming that a successful TCP connection proves both work.

3. Check the adapter, destination routes, and outbound

Run the PowerShell commands below once before and once after enabling TUN. The first lists the network adapters visible to Windows; the second displays the IPv4 routing table. These commands only read system status and do not change your configuration.

Get-NetAdapter -IncludeHidden | Format-Table Name, Status, ifIndex
route print -4

4. No connection, lost LAN access, or DNS failures after enabling TUN

Start with one failure that you can reproduce consistently. Disable TUN to confirm the original connection path, then enable it and reproduce the issue. Change only one setting at a time. Record the destination, time, and first error; do not mistake a cascade of retry timeouts for the root cause.

The network drops as soon as I enable TUN and comes back when I disable it. What should I check first?

First check the startup log for permission or route installation errors, then compare the routing tables before and after. If another tunnel that you are authorized to pause is running, test each tunnel separately against the same destination. If the issue occurs only when both are on, check whether they compete for destination routes or DNS. Do not delete system routes outright.

Webpages load, but why is my printer offline?

First test the printer's actual LAN address—for example, confirm the device is really at 192.168.1.50—then check the route to that address. If the address is reachable but automatic discovery fails, investigate LAN discovery or multicast. If the address is unreachable too, check whether the local subnet is being incorrectly routed through the tunnel and, in an authorized configuration, preserve the local route for that subnet.

The logs show DNS timeouts. Should I change the MTU first?

No. Start by querying the affected domain with Resolve-DnsName, comparing the results before and after the routing change, and checking the core logs for resolution errors. This command tests the system's DNS resolution path, which may differ from the app's built-in resolver. Only investigate path MTU and other transport factors if name resolution is consistent, short requests succeed, and larger transfers repeatedly stall.

TUN is off, but I still cannot connect. How do I restore the original setup?

First turn off “Enable TUN” and exit the client normally. Then check whether the system proxy has returned to its state before testing. If you want to restore a direct connection, open Windows “Settings” → “Network & Internet” → “Proxy” and check whether it still points to a local listening port that is no longer running. To return to system proxy mode, start the client, confirm that its listener is ready, and then restore the system proxy. Finally, reopen the app to test a new connection.

Download v2rayNChoose a package for your platform