Contents
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.
How networks work — series: ① What happens when you open a website → ② Network layers → ③ Common network protocols → ④ What is a proxy? → ⑤ What is a VPN? → ⑥ VPN vs proxy → ⑦ What HTTPS encrypts → ⑧ System proxy vs TUN mode → ⑨ Split tunneling → ⑩ DNS poisoning and leaks → ⑪ Why it slows down at night → ⑫ Latency, loss and bandwidth
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.
- ① System proxyA proxy address registered in system settings
- ② Programs that opt inBrowsers and others follow the sign
- ③ Programs that don'tGames and the terminal slip out the side door
- ④ TUN modeOne gate that every packet must pass
- ⑤ Overseas servicesSent into the encrypted tunnel by rule
- ⑥ 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:
| Program | Honours the system proxy? |
|---|---|
| Browsers such as Chrome, Edge and Safari | Usually |
| Most desktop and mobile apps | Some do, depending on the developer |
| Command-line tools (git, curl, npm, pip…) | Usually not — they need environment variables |
| Games, some chat and video apps | Often 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:
| Mode | What it does | Good for |
|---|---|---|
| Global | Everything goes through the tunnel | Quick 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 blocked | Everyday use: local sites stay fast, overseas services stay reliable |
| Direct | Nothing goes through the tunnel | Pausing 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
| Step | What 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:
| Platform | System mechanism | What you see on first connect |
|---|---|---|
| iPhone / iPad | Network Extension (packet tunnel) | “Would Like to Add VPN Configurations”, confirmed with your passcode or Face ID |
| Mac | System extension + Network Extension | Allow the system extension, then allow the VPN configuration |
| Android | VpnService | A “Connection request” dialog |
| Windows | TUN adapter driver | A 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.
Related reading
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