v2rayN TUN Mode: How It Works and How to Enable It

TUN can route command-line and gaming traffic that ignores the system proxy. Learn how TUN differs from the system proxy, why it needs administrator access, how to enable it, and how to troubleshoot common conflicts.

At a Glance

This guide is for users with a working node whose terminal tools or games don't use the Windows system proxy. The steps cover v2rayN 7.x on Windows: keep a known-good node, enable TUN separately, then check the network adapter, command-line requests, and logs to confirm the traffic path.

TUN vs. System Proxy: Different Entry Points, Same Routing Rules

The system proxy is a Windows setting. Apps that respect it send eligible requests to a local proxy port; apps with their own network settings may ignore it entirely. A site loading in your browser doesn't mean command-line tools are using the proxy.

Application network requestSystem route selectionPacket received by virtual adapterRouting rule matchOutbound handling

TUN is a virtual Layer 3 network interface. Once the client starts a TUN-capable component and configures system routes, IP packets matching those routes enter the virtual adapter and are handled according to the rules: direct, proxied, or blocked. “Global” means coverage is no longer limited to apps that read the system proxy; it doesn't mean every destination uses the same node. LAN traffic can bypass TUN according to your configuration, and the connection to the node server must also be excluded to prevent a routing loop.

System Proxy

Traffic entry point
Local proxy listening port
When it applies
The app reads and uses the proxy settings
Permissions
Changing proxy settings for the current user usually doesn't require elevation

If this works for apps like your browser, you can keep using it.

TUN Mode

Traffic entry point
Virtual adapter targeted by system routes
When it applies
The component is running and the traffic matches a route it handles
Permissions
Enable it on Windows as an administrator

Can receive TCP and UDP traffic matching its routes. Whether UDP can be forwarded depends on the selected outbound and the server.

Enable TUN on Windows: Keep a Baseline Before Switching

  1. Confirm the node works. Select a node in the v2rayN main window and use your existing proxy setup to visit an HTTPS site you normally use for testing. Note the current node, routing mode, and system proxy status. Keep the same node when you switch to TUN so a node issue isn't mistaken for an adapter problem.
  2. Restart as an administrator. Exit v2rayN from its notification area icon menu; don't just close the window. Right-click the app or shortcut, choose “Run as administrator,” and approve the Windows prompt. If your organization manages the computer and blocks elevation, check with your administrator first.
  3. Clear the system proxy set by the client. In v2rayN, choose “Clear System Proxy” from the “System Proxy” menu so the next test uses only the TUN path. If your organization manages the proxy settings, don't change them; run a separate comparison on an approved device.
  4. Turn on “Enable Tun.” Find the TUN switch at the bottom of the main window and turn it on. Labels and placement may vary between v2rayN 7.x releases. Check the main window log for permission, virtual interface creation, or route setup errors. A lit switch only confirms the UI changed; verify that traffic actually flows through TUN in the next step.
  5. Keep your existing routing rules. For the first test, don't change DNS, routing, and TUN settings at the same time. To check the client listening port, go to “Settings” → “Parameter Settings” and note the current value. Don't change it to the example port used below.

Verify TUN: Check the Adapter, Request, and Proxy Outbound Separately

10808
Common local proxy ports in v2rayN; check Parameter Settings for the actual value
443
The destination port for the HTTPS request below, not the local listening port

In Windows PowerShell, list the IPv4 interfaces. Run the command once before and once after enabling TUN, then compare the results. Next, send an HTTPS request without an explicit proxy and check the status line and client logs from the test time. This uses example.com to check basic connectivity. To verify proxy routing, use an HTTPS test URL known to match a proxy rule.

Get-NetIPInterface -AddressFamily IPv4
curl.exe --noproxy "*" --connect-timeout 10 --max-time 20 -v https://example.com/ -o NUL

How to confirm: Retest with a destination expected to match a proxy rule

Without an outbound log entry, you can only confirm whether the request connects. Test the same destination with TUN on and off, then check the routes and logs. An adapter appearing or a webpage loading doesn't prove that proxy routing is working.

Common Conflicts: Permissions, DNS, LAN Access, and Game UDP

Why do I still get a permissions error after turning on TUN?

Exit v2rayN completely from the notification area, then start it as an administrator and make sure the previous instance has exited. If the logs still report an interface creation failure, note the error and check whether another running client is managing a virtual adapter. Don't change device management settings on a work computer just to test.

Can't resolve domain names after enabling TUN. Which setting should I change first?

Don't change anything yet. Run Resolve-DnsName example.com and note whether it returns an address before and after enabling TUN. If curl reports Could not resolve host, check the DNS settings and related logs first. If the name resolves but the connection times out, check the destination route and outbound. Your browser may use secure DNS, so don't use its results as a substitute for this comparison.

Can't access a printer or shared folder after enabling TUN?

First, test using the device's LAN IP, then try the same address with TUN off. If you know the shared host's address, use Test-NetConnection with that address and -Port 445 to check TCP connectivity. If it fails only with TUN on, check whether the local subnet is being routed into TUN or sent through a proxy outbound. Adjust the direct or exclusion rules for your actual subnet; don't apply one rule to every private network.

Why does my game still time out when webpages load?

The HTTPS test above checks TCP. First identify whether the issue occurs during login, matchmaking, or gameplay, then check connection logs for that period. If the game uses UDP, make sure both the selected outbound and the server support UDP forwarding. A single TCP latency test can't tell you whether gameplay traffic will get through.

Turn Off TUN: Restore the Previous Network Path

  1. Turn off “Enable Tun,” then use the commands from earlier to check whether the virtual interface and routes it handles are still in use. Don't manually delete the physical adapter's default route.
  2. Restore the system proxy settings you noted before enabling TUN. If you previously used the v2rayN system proxy, select “Set system proxy automatically” again. If you hadn't configured one, leave it cleared.
  3. Close and reopen affected apps so they create new connections. If the network stops working after the client exits unexpectedly, restart v2rayN, turn off TUN normally, and exit the app. Then check Windows “Settings” → “Network & Internet” → “Proxy” for settings left behind by the client.
Browse Client Downloads