VPN for the whole computer (zev vpn)
sudo zev vpn on sends every program through your own proxy server, with its DNS and IPv6, a kill switch, sites that need no proxy kept direct, and a leak test (zev vpn check) that proves nothing gets around it.
Search for a command to run…
sudo zev vpn on sends every program through your own proxy server, with its DNS and IPv6, a kill switch, sites that need no proxy kept direct, and a leak test (zev vpn check) that proves nothing gets around it.
zev proxy share gives apps a proxy port they can use if they're set up for it. zev vpn doesn't need any setup: every program on this computer, its DNS lookups and its IPv6, goes through your proxy server, the same one zev proxy use chose. It is Linux only for now.
sudo zev vpn on --kill-switch # everything through the proxy; nothing leaks if it stopszev vpn check # prove it: TCP, UDP (WebRTC), DNS, IPv6sudo zev vpn off # back exactly as it wasOne interface, zev0, catches everything. Point at each piece for what it is.
sudo only sets up the network: the proxy, its fixes and routes stay yours (~/.config/zev), and the VPN follows them when you change them, without being turned off and on again.
| Command | Example | What it does |
|---|---|---|
sudo zev vpn on | sudo zev vpn on | every program through the proxy, as a service (zev-vpn) that starts with the computer |
--kill-switch | sudo zev vpn on --kill-switch | if the VPN stops for any reason, nothing goes out directly; only the LAN works until it's back |
--exclude | sudo zev vpn on --exclude bank.example.com,192.0.2.0/24 | these names, addresses or ranges go direct |
zev vpn status | zev vpn status | on or off, through which server, since when, restarts and self-repairs |
zev vpn check | sudo zev vpn check | the leak test below; with sudo it also shows this network's own address, to compare |
sudo zev vpn off | sudo zev vpn off | the interface, routes, rules and firewall table removed; nothing left behind |
direct -- | sudo zev vpn direct -- steam · sudo zev vpn direct -- firefox --private-window | one program (and what it starts) outside the VPN; the rest stays in |
direct | sudo zev vpn direct | what runs outside the VPN now |
pause | sudo zev vpn pause · sudo zev vpn pause 1h · sudo zev vpn pause forever | everything directly for a while (10 minutes if you don't say), the kill switch too, then back by itself |
resume | sudo zev vpn resume | end a pause now |
trust | sudo zev vpn trust · sudo zev vpn trust ls | on this network the VPN steps aside; on any other it carries everything |
untrust | sudo zev vpn untrust this · sudo zev vpn untrust all | the VPN carries everything there again |
zev proxy start --tun | zev proxy start --tun --kill-switch | the VPN, the shared port and the desktop setting, in one command (asks for sudo) |
zev proxy top | zev proxy top | live traffic: the VPN, each server, what went direct |
zev proxy usage | zev proxy usage quota 50G | the proxy's data by day, a monthly limit, where it's heading (usage) |
zev proxy learn on | zev proxy learn on | sites that work without the proxy on this network go direct (learn) |
zev proxy why | zev proxy why youtube.com | which way one site goes, and why (why) |
A VPN that's on isn't necessarily a VPN that covers everything. zev vpn check asks the internet what it sees, the ways a website, a browser and a DNS server would:
$ sudo zev vpn checkzev vpn check a leak test: what the internet sees of this computer ✓ the VPN is on (zev0), through vless proxy.example.com:443 tcp+tls ✓ sites see 185.220.101.4 (DE) this network's own address is 198.51.100.34 (FR): hidden ✓ UDP too (what WebRTC in a browser shows): 185.220.101.4 ✓ DNS: a question to an address with no DNS server was answered inside the tunnel; no DNS question leaves around it ✓ IPv6: none on this network, nothing to leak ✓ kill switch: on; if the tunnel drops, nothing leaves direct on purpose (--exclude): bank.example.com No leaks found.A ✗ line is a leak, with what to do about it; zev vpn check then exits with status 1, so scripts can rely on it. With the VPN off, it shows what leaves the computer now, for comparison.
Without --kill-switch, traffic goes out directly while the VPN is down, which is better on a network where you'd rather be online than private.
sudo zev vpn on --exclude bank.example.com,192.0.2.0/24 # these names and ranges go directlysudo zev vpn on --kill-switch --exclude intranet.example # and nothing else gets out if the VPN stopssudo zev vpn run --for 60 # the VPN in this terminal for a minute (what the service runs; set up with sudo zev vpn on first)--exclude: names (and every name under them), addresses and CIDR ranges you list.zev proxy route direct … and the others apply to the VPN as well.sudo zev vpn direct -- <program> (below).zev proxy learn on, sites measured to work without the proxy on this network go direct: they're faster, and they don't use the proxy's data. Through the VPN, zev learns from the names programs look up.zev proxy why <site> says which of these applies to one site.
Some programs shouldn't go through the VPN: a bank that refuses foreign addresses, a game that needs the lowest latency, a video call on the office network. Run just that program outside it; everything else stays in:
sudo zev vpn direct -- steamsudo zev vpn direct -- firefox --private-windowsudo zev vpn direct -- curl -s https://example.com/ # check: this one goes directlysudo zev vpn direct # what runs outside nowOutside the VPN now 48213 steam 48290 steamwebhelperThe program runs as you (not as root), and everything it starts stays outside too. It works with the kill switch on: its traffic is marked as allowed to go directly, and only its traffic. Names it looks up still go through the VPN's DNS, so nothing about the rest of the computer changes.
How: the program starts in its own cgroup (zev-direct); one firewall rule marks that cgroup's connections, and marked connections take the computer's own route, the same way zev's engine reaches the proxy server. sudo zev vpn off removes the rule and the cgroup.
Need the real connection for a few minutes (a captive portal, a site that blocks VPNs, a speed test of your own line)? Pause it; it comes back by itself:
sudo zev vpn pause # 10 minutessudo zev vpn pause 30ssudo zev vpn pause 1h30msudo zev vpn pause forever # until you resume itsudo zev vpn resume # end the pause now⏸ VPN paused for 1 min: traffic goes directly, the kill switch is off too. The engine keeps running, so it comes back at once. sudo zev vpn resume ends the pause now.zev vpn status shows how long is left. During a pause the kill switch steps aside as well (that's the point of a pause); it's back with the VPN.
At home you may not want the VPN; on a café's Wi-Fi you do. Mark the networks you trust, and the VPN steps aside there by itself, and carries everything on any other network:
sudo zev vpn trust # the network you're on nowsudo zev vpn trust lssudo zev vpn untrust this # or a name from the list, or allA network is recognized by its router (its address and hardware address), checked every five seconds, so the switch happens as soon as you join another one. This only matters while the VPN is on: trusting a network never turns the VPN on or off by itself, and nothing starts at boot unless you ran sudo zev vpn on.
Every pause, trusted network and return is written to the history (zev proxy history).
zev creates the zev0 interface (172.19.0.1/30), adds policy routing rules (mark 7701 to the main table, everything else to table 7701, which points at zev0), points systemd-resolved at the tunnel's DNS (172.19.0.2) and runs the engine as a systemd service from its own root-owned copy in /var/lib/zev/vpn. sudo zev vpn off removes every one of these.
Every 30 seconds the service checks that traffic really gets through. After three failures in a row it notifies you, runs zev proxy doctor (DNS lies, a blocked port, SNI filtering, a clock that's off), saves the fix for this network and restarts the engine with it. A server that dies is replaced by the next of a pool on its own. With the kill switch on, zev doesn't pause the VPN to run the doctor.
The VPN already takes every DNS question into the tunnel. zev dns is for when the VPN is off, or for names you send direct: it finds which resolvers tell the truth on this network, checks DNSSEC signatures itself, and keeps the network's own DNS behind them. They work together; neither changes the other's settings.
| You see | What it means | What to do |
|---|---|---|
zev vpn check: UDP comes out elsewhere | the proxy server's protocol or setup doesn't carry UDP, or something sends it around | a link that carries UDP (VLESS, Trojan, Hysteria2, WireGuard); --kill-switch keeps it from leaking meanwhile |
zev vpn check: IPv6 warning | this network gives you public IPv6 and the tunnel is IPv4 | sudo zev vpn on --kill-switch |
Nothing loads, zev vpn status says failing | the server can't be reached from this network | zev proxy doctor, or another server: zev proxy use auto |
| A site works only without the VPN | it refuses visitors from the proxy's country | zev proxy route direct that-site.example, or zev proxy learn |
sudo zev vpn on on macOS or Windows | not yet | zev proxy share on with zev proxy system on |
sudo zev vpn off, or the service stopping without the kill switch, puts routing and DNS back as they were.