This guide uses v2rayN on Windows and is for anyone whose browser connects but whose terminal or desktop apps bypass the proxy. Check whether the app supports an explicit proxy before enabling TUN. Then verify the adapter, routes, routing rules, and local network access separately so you don’t mistake a node issue for a virtual adapter problem.
Virtual Adapters and Traffic Routing
The system proxy changes proxy settings that apps can read; TUN changes how the operating system routes IP packets. When TUN is enabled, the client creates a virtual adapter and installs the relevant routes. Apps connect to their destination as usual, without needing to know the local HTTP or SOCKS proxy port. Packets are handed to the component handling TUN traffic when their destination matches a route pointing to the virtual adapter.
“Routing traffic through TUN” describes how traffic enters the client; “proxying” describes how the client sends it onward. Connections entering TUN can still match direct, proxy, or reject rules. Outbound connections to a proxy server also need a working underlying network connection. If they are routed back into the virtual adapter, a routing loop can occur. So enabling TUN does not automatically mean all traffic is proxied, nor does it send every device packet down the same path.
- Check the system routes: A more specific route can take precedence over a broader one. Check dedicated subnets used by other VPNs, local network subnets, and IPv6 routes separately.
- Check outbound support: TUN can receive UDP traffic that matches its routes, but forwarding depends on the core configuration, rules, and selected outbound. A webpage loading successfully doesn’t confirm that voice calls or other UDP features will work.
- Check the DNS path: DNS requests may be handled by the system, the client, or the app itself, depending on the configuration. Domain-based matching and destination-IP matching are different; note which destination the rules identify when troubleshooting.
System Proxy or TUN?
Whether you need TUN depends on how an app makes connections, not whether it’s a browser, terminal, or game. If the app reads the system proxy settings or lets you set a proxy address, start with an explicit proxy. Consider TUN only when the app neither uses the system proxy nor offers a usable proxy setting, and you need v2rayN to handle its connections.
System Proxy and Explicit Proxy
- Connection method
- App connects to a local proxy listener
- System setting
- Windows Settings → Network & internet → Proxy
- Example port
127.0.0.1:10808; check the actual listener and protocol- Best for
- Apps that use the system proxy or let you configure a proxy individually
Tools that support HTTP proxies need a listener that accepts HTTP proxy requests. Don’t infer the protocol from the port number alone.
TUN Virtual Adapter
- Connection method
- The operating system routes IP packets through the adapter
- App configuration
- A local proxy port usually isn’t needed
- Permissions
- On Windows, permission is required to create a network adapter and change routes
- Best for
- Apps that connect directly without usable proxy settings
Once traffic enters the virtual adapter, the client’s rules determine which outbound to use.
Try the app’s built-in proxy settings first
If you only need to proxy one command-line tool, check whether it supports proxy options or environment variables. This changes the connection settings for that tool only, without changing the routes for your entire computer.
Enable TUN on Windows: Steps and Permissions
These steps reflect the common interface in v2rayN 7.x for Windows desktop; menu locations may vary by version and interface type. First, check existing listeners and TUN options under Settings → Parameter settings, then look for the Enable Tun switch on the main screen. For your first test, don’t change nodes, DNS, and TUN at the same time—it’ll be hard to tell which change affected the result.
- Establish a baseline. Leave TUN off, select an existing node, and use a browser that supports the system proxy to visit a site you can already test. If that fails, check the core startup logs and node connection before proceeding. TUN won’t fix a node problem.
- Check permissions and your existing network setup. Note the current system proxy status, active network adapters, and any VPN you need for work. If a standard launch can’t create the virtual adapter, fully exit v2rayN from the system tray, then right-click it in Windows and select Run as administrator. On managed computers, check that you’re allowed to install or enable a virtual adapter.
- Enable TUN on its own. To distinguish the two connection methods, you can clear the system proxy set for this test from v2rayN’s system proxy menu, then make sure the test app has no individually configured proxy before enabling TUN. Don’t clear managed settings if your computer relies on an organization’s proxy; instead, test with an app that doesn’t read those settings.
- Test and record the results. Start a new test connection, then check the target app, a regular webpage, and any local network services you need to keep working. Compare before and after using the same node and destination. Attribute a change to TUN only when the logs or routes correspond to that new connection.
Troubleshoot Adapter, Routes, and Connectivity
Open Windows PowerShell and run the read-only commands below before and after enabling TUN. The first shows IP interfaces; the second lists IPv4 routes and their associated interfaces. Don’t rely on a fixed adapter name: aliases can vary by version, system language, and installed network components. If only IPv6 access is affected, replace IPv4 with IPv6 in both commands and compare again.
Get-NetIPInterface -AddressFamily IPv4 |
Format-Table ifIndex, InterfaceAlias, ConnectionState, InterfaceMetric
Get-NetRoute -AddressFamily IPv4 |
Format-Table ifIndex, DestinationPrefix, NextHop, RouteMetric
- The adapter doesn’t appear: Check the logs from the time you enabled TUN to distinguish insufficient permissions, component initialization failures, and core configuration errors. If the error mentions a failed port bind, check the specific address and port in the message. For example, if
10808is already in use, identify the process and what the listener is used for before changing the virtual adapter address. - The adapter is present, but the destination is unreachable: Check which route covers the destination IP. If two routes match, compare their prefix lengths first; the lowest-metric row alone doesn’t tell you which route is used. If the traffic reaches the core, check the logs to see whether it matched the expected outbound.
- Websites load, but local network services are unreachable: Retest the same printer, file server, or gateway using its usual address. If its IP works but its name doesn’t, check DNS first. If the IP is also unreachable, check whether its subnet is routed through TUN and whether a direct rule covers it. Don’t send every private subnet through the same outbound; some are only reachable through a corporate VPN.
- Everything disconnects after enabling TUN: Turn TUN off, restore the system proxy settings from before the test, and check the original network again. If the issue occurs only when another VPN is also enabled, compare their destination prefixes and DNS settings. Don’t disable network protection required by your organization just to test.
Common Questions and How to Test
My browser uses the proxy. Do I need TUN for the terminal?
First, check whether the specific terminal tool accepts an HTTP proxy option or HTTPS_PROXY. If it does, set the actual working local HTTP listener for the current terminal session and retry the same request. Test with TUN only if the tool doesn’t accept this configuration or use the system proxy.
Why hasn’t my public IP changed with TUN enabled?
Start a new connection and check the core logs to see whether the test destination entered TUN and matched a direct rule. If the test address was routed directly, an unchanged public IP is expected. Try another destination that clearly matches a proxy rule and check its outbound. One IP lookup doesn’t show how all traffic on the computer is routed.
Can I use the system proxy and TUN at the same time?
Both can be enabled at once, but apps that read the system proxy may still connect to the local proxy listener first, while other apps follow system routes into TUN. For troubleshooting, use one connection method at a time and fully close and reopen the target app to avoid interference from existing connections or proxy environment variables.
What should I do if I still can’t connect after turning TUN off?
Exit the client first. Check whether Windows Settings → Network & internet → Proxy still points to a local listener that has stopped, and restore the previous settings. Then use the read-only commands above to compare the original interfaces and routes. If only one app fails, check whether it still has a manual proxy configured. Don’t clear the system routing table.