Contents
Explainers

System Proxy vs TUN Mode: Three Ways to Route Your Traffic

Why do command-line tools and games ignore your proxy? A system proxy relies on programs opting in, while TUN mode uses a virtual adapter to capture all traffic at the network layer — and global vs split routing decides what happens next. Compared step by step in a sequence diagram.

Last updated:

There are two ways to get a device’s traffic into an encrypted tunnel. A system proxy registers a proxy address in your system settings and leaves each program to decide for itself whether to use it — browsers usually do, command-line tools and games often don’t. TUN mode creates a virtual network adapter that captures traffic from every program at the network layer, no cooperation needed. Once traffic is captured, global or split routing decides what goes through the tunnel and what connects directly.

Illustration: on the left, app characters such as a browser follow a sign to the proxy desk while a game controller and a terminal slip out of a side door; on the right there is one gate, and a gatekeeper sends every app either into a tunnel or to a local town
  1. ① System proxyA proxy address registered in system settings
  2. ② Programs that opt inBrowsers and others follow the sign
  3. ③ Programs that don'tGames and the terminal slip out the side door
  4. ④ TUN modeOne gate that every packet must pass
  5. ⑤ Overseas servicesSent into the encrypted tunnel by rule
  6. ⑥ Local sitesGo direct by rule — no detour

System proxy: only programs that opt in

Every operating system has proxy settings: on Windows under Settings → Network & internet → Proxy, on macOS under System Settings → Network → Details → Proxies. When a VPN client turns on system proxy mode, it starts a proxy service on your machine and registers its port there.

The catch is that this is only a notice — each program decides whether to follow it:

ProgramHonours the system proxy?
Browsers such as Chrome, Edge and SafariUsually
Most desktop and mobile appsSome do, depending on the developer
Command-line tools (git, curl, npm, pip…)Usually not — they need environment variables
Games, some chat and video appsOften not — they connect directly

Hence the classic “the browser works, but git clone in the terminal still times out” or “the game still can’t connect”.

TUN mode: capture everything at the network layer

TUN is a virtual network adapter provided by the operating system. It works at the network layer and handles IP packets. Once the client creates one and points the system’s default route at it:

  • every packet any program sends — whether or not it reads proxy settings — is handed to the virtual adapter first;
  • the client reads packets from the adapter and decides, by rule, whether each goes through the tunnel or direct;
  • the programs themselves never need to know.

TUN mode captures UDP and DNS as well as TCP. To stop domain lookups escaping the tunnel (a “DNS leak”), clients usually intercept queries to port 53 and resolve them inside the tunnel.

Global vs split: what goes through the tunnel

However traffic is captured, something has to decide where it goes next:

ModeWhat it doesGood for
GlobalEverything goes through the tunnelQuick troubleshooting; making the whole device exit overseas
Split (Smart)Rules decide connection by connection: local sites direct, overseas services through the tunnel, ads can be blockedEveryday use: local sites stay fast, overseas services stay reliable
DirectNothing goes through the tunnelPausing without disconnecting

Rules can match by domain, IP range, country and more — see Custom routing rules for rule types, order and syntax.

Sequence diagram: the two approaches step by step

Any program OS VPN client VPN server Website SYSTEM PROXY: PROGRAMS OPT IN Read proxy settings 1 Local proxy port 2 Hand request to the client 3 Encrypted 4 Visits the site 5 PROGRAMS THAT IGNORE THE SETTING: DIRECT Connects straight to the site (bypasses proxy) 6 TUN MODE: ALL TRAFFIC GOES TO THE VIRTUAL ADAPTER Sends packets as usual 7 Route via TUN 8 Apply routing rules 9 Overseas: encrypted 10 Local: direct 11
Thick lines are encrypted. TUN mode doesn't need programs to cooperate: all traffic reaches the client first, and routing rules decide where it goes.
StepWhat happens
①–②In system proxy mode, the program reads the system’s proxy settings and gets the port of the local proxy (the client)
③The program hands its request to the client
④–⑤The client encrypts it to the server, which visits the site
⑥Programs that ignore proxy settings (command-line tools, games) connect straight to the site, bypassing the proxy entirely — the gap in system proxy mode
⑦In TUN mode, the program sends packets as usual, with no settings at all
⑧The system checks its routing table, sees the default route points at the virtual adapter, and hands the packet over; the client reads it from there
⑨The client applies the routing rules to decide where the packet goes
⑩Overseas services: encrypted and sent to the server
⑪Local sites: sent directly out of the real network card, no detour

Why you approve a network configuration the first time

A virtual adapter reroutes the whole device, so every operating system requires your explicit consent and tightly limits what it can do:

PlatformSystem mechanismWhat you see on first connect
iPhone / iPadNetwork Extension (packet tunnel)“Would Like to Add VPN Configurations”, confirmed with your passcode or Face ID
MacSystem extension + Network ExtensionAllow the system extension, then allow the VPN configuration
AndroidVpnServiceA “Connection request” dialog
WindowsTUN adapter driverA User Account Control (administrator) prompt

Pangolin uses TUN on all four platforms with Smart routing on by default, so command-line tools, games and every other app are covered without extra setup. Each platform’s approval steps are in its install guide, e.g. Install on iPhone / iPad and Install on Mac.

FAQ

Why don't git and curl in my terminal use the proxy?

A system proxy only applies to programs that read the setting, and many command-line tools don't by default — you'd have to set environment variables such as HTTPS_PROXY. In TUN mode nothing needs configuring; terminal traffic is captured by the virtual adapter too.

Does TUN mode affect LAN devices like printers and a NAS?

Not normally. Routing rules almost always send local-network traffic direct, so your router, printer and NAS are reached without the tunnel. Pangolin makes this rule mandatory — it can't be switched off.

Why is there a new network connection or VPN profile in my system settings?

That's the virtual adapter itself. The operating system manages it like any other network connection, which is why you approve it the first time and can see its status in your settings afterwards.

Don't have Pangolin yet?

Available for iPhone / iPad, Mac, Windows and Android. New accounts get a free 7-day Pro trial.

Download the app
← All posts