TUN mode vs system proxy: what's the difference and which to use

A system proxy is an address written into the network settings: only programs that read it send traffic there, mostly browsers, and almost always only TCP. TUN mode creates a virtual network adapter and points the system's routes at it, so every program goes into the tunnel, TCP and UDP, games, calls and command-line tools included. TUN needs administrator rights and gives a VPN for the whole computer; a proxy is lighter but leaves gaps. “Global” and “Rule” in Clash-like clients are a separate switch: they choose where traffic goes, not how the client gets it.

Updated

On this page

System proxy: an address in the settings

A system proxy is a line in the network settings: send web traffic to 127.0.0.1, port such-and-such. The client listens on that port and carries whatever arrives to the server. On Windows it is in Settings → Network & internet → Proxy.

The setting is a request, not a rule. Chrome, Edge and Firefox with default settings follow it. A program that doesn't read it connects straight to the network: many games, messengers and updaters, and nearly all command-line tools. The usual system proxy is an HTTP proxy, which carries only TCP, so UDP, the traffic of calls, games and WebRTC, goes past it.

TUN mode: a virtual network adapter

TUN is a virtual network adapter the client creates, with the system's routes changed so that traffic to the internet goes into it instead of Wi-Fi or Ethernet. The client reads every packet coming out of the adapter, TCP or UDP, and carries it through the tunnel; programs don't need to know. WireGuard and OpenVPN have always worked this way, and this is what “TUN mode” means in clients built on Xray, sing-box or mihomo.

Creating an adapter and changing routes are system changes, so TUN needs administrator rights on Windows and root on macOS and Linux: clients ask to run as administrator or install a helper service once. On Android every VPN app works this way: after you allow the VPN, the system gives the app a virtual adapter for the whole phone.

  • Routes — the client keeps its own connection to the server out of the adapter, or that traffic would go round in a loop.
  • DNS — name lookups enter the adapter too; a good client answers them itself or sends them through the tunnel.

What goes through: proxy vs TUN

  • Pages in the browser

    System proxyYes, if the browser follows the system setting

    TUNYes

  • WebRTC in the browser (UDP)

    System proxyNo, it goes direct

    TUNYes

  • Messengers, launchers, updaters

    System proxyOnly those that read the setting

    TUNYes

  • Games

    System proxyNo: their own connections, mostly UDP

    TUNYes, if the server's protocol carries UDP

  • Voice and video calls in apps

    System proxyUsually not: calls go over UDP

    TUNYes

  • curl, git, pip, npm

    System proxyNo: they read HTTP_PROXY and HTTPS_PROXY

    TUNYes

  • System DNS lookups

    System proxyNo: to your provider's DNS

    TUNYes, taken in the adapter

  • Administrator rights

    System proxyUsually not needed

    TUNNeeded

Global, Rule and Direct are not TUN

Clash-like clients have a mode switch: Rule, Global, Direct. It decides where traffic goes once the client has it: by the rules, all through the server, or all straight out. Which traffic reaches the client at all is decided by the system proxy or TUN.

So Global with a system proxy still misses games, calls and terminal tools: they never reach the client. TUN with Rule takes everything and sends part of it direct. For a VPN for the whole computer you need TUN; global or rule is routing on top of it.

Why a proxy leaks WebRTC and DNS

With TUN both gaps close by themselves: STUN requests and DNS lookups enter the adapter. What stays outside is what the rules send direct, and IPv6 if the tunnel carries only IPv4.

  • WebRTC — calls in the browser learn your public address with a UDP request to a STUN server. UDP goes past an HTTP proxy, so a WebRTC test shows your provider's address while IP check sites show the server.
  • DNS — the browser hands the site's name to the proxy, but programs outside the proxy ask your provider's DNS, and a DNS leak test shows those servers.

How to see which mode is on

Windows (cmd or PowerShell)
reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" | findstr /i proxy

ProxyEnable 0x1 with ProxyServer 127.0.0.1:… — the proxy browsers follow is on; 0x0 — off. Same switch as Settings → Network & internet → Proxy.

Windows
netsh winhttp show proxy

A separate setting for system services. Direct access (no proxy server). means none here, but clients usually set the one above.

macOS
scutil --proxy

HTTPEnable : 1, HTTPSEnable : 1 or SOCKSEnable : 1 with HTTPProxy : 127.0.0.1 — a system proxy is on.

Linux (GNOME)
gsettings get org.gnome.system.proxy mode

'manual' or 'auto' — a proxy is set; 'none' — no proxy. Terminal tools follow variables instead: env | grep -i proxy.

Windows (PowerShell)
Get-NetAdapter

With TUN on, an extra adapter is Up; its description usually names the driver or program, such as Wintun or WireGuard. It goes away after you disconnect.

macOS
ifconfig | grep utun

macOS keeps a few utun interfaces of its own. Compare before and after connecting: the new one is the tunnel.

Linux
ip link

Look for tun0, wg0 or a name the client chose, with POINTOPOINT and UP in its flags.

TUN is on, but there's no internet

  • The TUN switch doesn't stay on, or the adapter isn't created

    CauseNo administrator or root rights, or the client's helper service isn't installed

    What to doRun the client as administrator or install its service, then turn TUN on again

  • Nothing opens in any program

    CauseAnother VPN or TUN is up at the same time, and their routes and DNS clash

    What to doLeave one tunnel; check Get-NetAdapter or ip link for extra adapters

  • Nothing opens, but the system proxy works

    CauseA firewall or antivirus blocks the client's core (xray, sing-box, mihomo), or the connection to the server loops back into the adapter

    What to doAllow the core in the firewall, update the client, check that no rule sends the server's own address into the tunnel

  • Sites don't open by name; nslookup example.com times out

    CauseDNS isn't taken into the adapter, or the client's DNS server doesn't answer

    What to doTurn on DNS capture (often DNS hijack) in the TUN settings, or pick another DNS server

  • Only one browser fails

    CauseIts own secure DNS (DoH) server or a proxy extension

    What to doSet secure DNS back to the default, turn the extension off

  • After closing the client the browser shows ERR_PROXY_CONNECTION_FAILED

    CauseThe system proxy still points to 127.0.0.1, and nothing listens there

    What to doTurn the proxy off in Settings → Network & internet → Proxy

  • Sites open, games and calls don't

    CauseThe server or its protocol doesn't carry UDP

    What to doAllow UDP on the server, or use a protocol that carries it

In Veli

Veli has no proxy mode: always the adapter

On a computer Veli brings up a virtual network adapter and sends the whole system's traffic into it, TCP and UDP. It doesn't set a system proxy, so there is no mode to choose. On Windows the app asks for administrator rights: it needs them to turn on the VPN and leak protection; if you declined, a notice with “Restart as administrator” stays at the top of the window. On a Mac or Linux a system component does this job, installed once with the system password; without it the window says “The system component is not installed”. On Android it is the system VPN.

What goes past the tunnel is set on Apps and sites: “Everything through the VPN except…” or “Through the VPN only…”, then “Reconnect”. Diagnostics → Privacy shows which addresses and DNS servers sites see and says “There is a leak” when something goes past the tunnel.

FAQ

What is the difference between TUN mode and a system proxy?

A system proxy is an address in the OS settings that only some programs follow, mostly browsers, and usually only for TCP. TUN creates a virtual network adapter and routes all of the system's traffic into it, TCP and UDP.

Which is better, TUN or system proxy?

For a VPN for the whole computer, TUN: it takes games, calls and terminal tools too and doesn't let WebRTC or DNS past the tunnel. A proxy is enough if only the browser needs the server.

Is TUN mode the same as global mode?

No. TUN is how the client gets the traffic; Global, Rule and Direct decide where it sends it. Global with a system proxy still misses programs that ignore the proxy.

Why does TUN mode need administrator rights?

Creating a network adapter and changing routes are system changes: Windows asks for administrator rights, macOS and Linux for root, often once, through a helper service.

Why is there no internet in TUN mode?

Most often another VPN or TUN is on at the same time, a firewall blocks the client's core, DNS isn't taken into the adapter, or the client's own connection loops back into it.

A tunnel for the whole system

On a computer Veli takes every program's traffic through a virtual network adapter, TCP and UDP, with no proxy setting to forget about.