Kill Switch
Also called: VPN kill switch, internet kill switch, network lock, network kill switch
Definition. A VPN kill switch is a set of firewall or routing rules that lets traffic leave a device only through the VPN tunnel and to the VPN server. If the tunnel drops, apps lose their connection instead of exposing your real IP and DNS.
Stanislav Vovchyk · Updated Nov 7, 2026 · 22 tools have it
In short
- A kill switch blocks traffic while the tunnel is down. Auto-connect only restarts the VPN.
- Most kill switches are lifted when you click Disconnect or quit. Lockdown-style modes keep the block in place.
- TunnelVision (CVE-2024-3661) leaks traffic while the VPN still shows connected, so a reactive kill switch never fires.
- Test it by killing the VPN process or switching networks, and test IPv6 separately.
A VPN kill switch is a set of operating-system firewall or routing rules that lets traffic leave your device only through the VPN tunnel and to the VPN server. When the tunnel drops, apps get no connection at all, so your real IP address and your ISP's DNS servers stay hidden. Tunnels drop for ordinary reasons: a Wi-Fi to cellular handover, sleep, a timeout, a client crash or a server outage.
What a VPN kill switch is (and what it is not)
A kill switch is the block that stops traffic while the tunnel is down. It does not reconnect anything: auto-connect and always-on VPN do that, restarting the VPN when the device boots or the network changes. On Android the block is a separate switch, "Block connections without VPN", and on iOS a system-level block exists only on MDM-supervised devices.
Vendors use their own names: ExpressVPN calls it "Network Lock", Windscribe "Firewall" and TunnelBear "VigilantBear". Mullvad's "Lockdown mode" is a stricter variant. Judge each one by what it blocks and when, not by its name. As of November 2026, 22 of the 24 VPNs in our catalogue list a kill switch of some kind.
A kill switch is also not DNS leak protection, which sends DNS queries to the VPN's resolver while the tunnel is up. The kill switch covers the time when the tunnel is down. A working tunnel can still leak DNS if the OS sends queries elsewhere, so you need both.
How a kill switch works under the hood
There are two designs:
The block rules stay in place, so a dropped tunnel means no connection rather than a leak.
- Firewall-based. The client writes rules into the OS packet filter: WFP on Windows, pf on macOS, nftables or iptables on Linux. On mobile it uses the system VPN frameworks (Android VpnService lockdown, Apple includeAllNetworks). The rules stay in place whether the tunnel is up or not.
- Reactive ("monitor and kill"). The client watches the tunnel and closes apps or adds blocks once it sees a drop. The first packets can leak in the gap between the drop and the reaction.
A firewall-based kill switch works like this:
- The client installs rules for both IPv4 and IPv6. Traffic may leave through the tunnel interface (tun or wg0), and the client's own packets may go to the VPN server's IP and port. DHCP is allowed, and so is the LAN if you choose; everything else is blocked.
- Default routes (0.0.0.0/0 and ::/0) send app traffic into the tunnel.
- The client encrypts the packets and sends them over the physical interface to the VPN server, which forwards them to the internet.
- The client monitors handshakes and keepalives. At some point the tunnel fails.
- Apps try to reach the internet over the physical interface. The block rules are still there, so those packets are dropped or rejected.
- The client reconnects. Only traffic to the VPN server gets through the block.
- Once the tunnel is back, traffic flows again. If you disconnect or quit, a normal kill switch removes its rules. Lockdown mode keeps them.
WireGuard has no kill switch of its own. The wg-quick(8) man page gives an optional rule for a peer whose AllowedIPs includes 0.0.0.0/0:
PostUp = iptables -I OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL -j REJECT
PreDown = iptables -D OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL -j REJECT
The rule rejects any packet that isn't leaving through the tunnel, isn't marked as coming from WireGuard's own UDP socket and isn't local. The man page warns that IPv6 needs matching ip6tables rules.
Kill switch vs Lockdown mode vs always-on VPN vs app-level kill switch
| Type | Tunnel drops | You click Disconnect | You quit the app | At boot, before the VPN starts | Split-tunneled apps |
|---|---|---|---|---|---|
| Basic kill switch (system-level) | Blocked | Open: rules removed | Open with most apps | Open | Usually stay open |
| Lockdown / always-require | Blocked | Blocked (Windows LockDown has no user Disconnect) | Blocked | Blocked | Mullvad documents that they keep access |
| Always-on / auto-connect only | Open until it reconnects | Open | Open | VPN starts, but nothing is blocked first | Not applicable |
| App-level kill switch | Only selected apps are closed or blocked; others use your real connection | Open | Open | Open | Not applicable |
In the Mullvad desktop app, the basic kill switch is always on and can't be turned off. Lockdown mode is an extra option that also blocks traffic after you disconnect or quit. Split tunneling sends traffic outside the tunnel on purpose, which is why those exclusions usually stay open.
Built-in kill switches on Windows, macOS, iOS, Android and Linux
Android. Always-on VPN has been available since Android 7.0 (API level 24, 2016). The blocking control is at Settings > Network & internet > VPN > gear icon > "Block connections without VPN". The Android VPN developer guide says that when it is on, "the system blocks any network traffic that doesn't use the VPN", and that a user or an IT admin can turn it on.
- From Android 8.0, Settings warns that there is no internet until the VPN connects. If an always-on VPN disconnects, you get a notification you can't dismiss.
- From Android 8.1, a VPN app can opt out by setting SERVICE_META_DATA_SUPPORTS_ALWAYS_ON to false. The Settings controls are then greyed out.
- VPN apps call VpnService.protect() to keep their own tunnel socket outside the VPN. Without it, the tunnel would try to route through itself.
iOS and macOS. Apps get kill-switch behaviour by setting NEVPNProtocol.includeAllNetworks = true. When the VPN leaves the connected state, for example during a Wi-Fi to cellular handover, the system drops network traffic. When the VPN starts connecting, existing TCP connections are not closed, but their later packets are dropped.
Apple's routing documentation lists traffic that is always excluded: control-plane traffic such as DHCP and traffic to the VPN server, captive-portal negotiation, cellular-only services such as VoLTE, and companion-device traffic such as Apple Watch. If includeAllNetworks is true, the system ignores enforceRoutes.
A system-level always-on VPN on iOS needs an always-on profile on an MDM-supervised device. The system then drops traffic whenever the VPN is not connected, including during startup. The profile can exempt apps (ApplicationExceptions) and the services VoiceMail, AirPrint and CellularServices (ServiceExceptions).
Windows. A VPN profile with LockDown allows traffic only over the VPN interface and uses a forced tunnel, so outbound traffic is blocked if the VPN is unavailable. The user can't disconnect it or change or delete the profile, and a device can have only one LockDown profile.
According to Microsoft's VPN security documentation, the built-in client supports LockDown only for IKEv2, configured through the VPNv2 CSP or ProfileXML. Separately, Traffic Filters apply firewall rules to the VPN interface, either per app or by 5-tuple (ports, addresses, protocol).
Linux. There is no OS switch: you use the wg-quick rule above or a network namespace. With AllowedIPs set to 0.0.0.0/0, wg-quick uses ip-rule policy routing and an fwmark on WireGuard's own socket to override the default gateway.
Most DHCP traffic still gets past the wg-quick rule, because DHCP clients use PF_PACKET sockets that bypass Netfilter. WireGuard's network-namespace setup puts the physical network cards in a separate namespace, so ordinary processes see only wg0 and have no direct path out.
Where kill switches fail: known leaks and attacks
Android connectivity checks (2022). In October 2022, Mullvad reported (audit finding MUL22-03) that Android sends connectivity checks outside the tunnel every time it joins a Wi-Fi network, even with "Block connections without VPN" on. These checks (DNS lookups, HTTP(S) and possibly NTP) expose your source IP. Stock Android has no user setting to stop them, but adb or GrapheneOS can disable them.
iOS existing connections (2020). Proton reported that on iOS 13.4, connections opened before the VPN connected could stay outside the tunnel indefinitely. Apple's response in iOS 14 was includeAllNetworks, a kill-switch option for apps, rather than a fix for the root cause. Proton's 2022 update said some Apple-service DNS queries still went outside the VPN.
TunnelCrack (2023). TunnelCrack was disclosed on 8 August 2023 and presented at USENIX Security 2023. It covers two attacks: LocalNet (CVE-2023-36672, CVE-2023-35838) and ServerIP (CVE-2023-36673, CVE-2023-36671). Both abuse the routing exceptions that clients add for the local network and for the VPN server's IP.
The researchers tested more than 66 VPNs on five platforms. Every iOS VPN app was vulnerable to LocalNet, and so were about a quarter of Android apps. Their fix is to send everything through the tunnel except traffic generated by the VPN app itself.
TunnelVision (CVE-2024-3661, 2024). Leviathan Security disclosed TunnelVision on 6 May 2024. A rogue DHCP server uses option 121, the classless static routes option from RFC 3442 (December 2002), to push routes more specific than the VPN's default route, such as two /1 routes. Traffic then leaves through the physical interface while the VPN's control channel stays up, so the client still shows "connected" and a reactive kill switch never fires.
Windows, Linux, iOS and macOS were affected. Android was not, because it does not implement option 121. Firewall rules that block the physical interface except for DHCP and the VPN server do mitigate the attack, at the cost of a selective denial of service and a traffic-analysis side channel. The researchers' strongest recommendation was network namespaces.
IPv6. Rules written only for IPv4 leave IPv6 open.
How to test your kill switch properly
Clicking Disconnect is not a test, because most apps lift the kill switch on purpose when you disconnect. Cause a real failure instead:
- With the VPN connected, open an IP-check page such as am.i.mullvad.net or ipleak.net. Note the VPN IP and DNS servers it shows.
- Start continuous traffic:
ping -t 1.1.1.1on Windows orping 1.1.1.1on macOS and Linux, plus a page that keeps reloading or a large download. - Make the tunnel fail: end the VPN's background process in Task Manager or Activity Monitor, switch Wi-Fi networks, or block the VPN server's IP on your router. Pings should time out and nothing should load until the tunnel comes back.
- Reload the IP-check page during the outage. If your ISP's IP or DNS appears at any point, the kill switch failed.
- For the strongest check, capture packets on the physical interface with Wireshark or
tcpdump -i <wifi-iface> not host <vpn-server-ip>while you cause the drop. Any packets other than DHCP or ARP mean a leak. - Test IPv6 separately, for example at test-ipv6.com.
- Quit the app and reboot, then check whether traffic is blocked before the app starts. Only Lockdown-style modes should pass this.
- On Android, confirm that "Always-on VPN" and "Block connections without VPN" are both on. Connectivity checks still bypass them.
- On Linux with WireGuard, run
sudo iptables -S OUTPUTandsudo ip6tables -S OUTPUT. Each should show a REJECT or DROP rule for non-tunnel traffic.
Trade-offs: no internet, captive portals and LAN access
"No internet" while the VPN reconnects means the kill switch is doing its job. If the VPN can't reach its server at all, the block stays until you fix the connection or turn the block off.
Captive portals. Hotel and airport login pages are a common reason people turn the kill switch off. If the portal is blocked, the VPN can't connect.
With includeAllNetworks, Apple always lets captive-portal negotiation through. On an MDM always-on profile, it only gets through if AllowCaptiveWebSheet or the related captive keys are enabled.
LAN access. Printers and NAS drives need a local-network exception. On Apple platforms, apps can set excludeLocalNetworks (AirPlay, AirDrop, CarPlay), excludeCellularServices (Wi-Fi Calling, MMS, SMS, Visual Voicemail) and excludeAPNs (push notifications). Every exception is a hole, and TunnelCrack's LocalNet attack works through exactly this kind of local-network exception.
Android apps bound to a network. Apps that bind to a specific network with bindProcessToNetwork or bindSocket have no connection while non-VPN traffic is blocked.
I'd keep Lockdown on for torrenting and on any network I don't control, such as public Wi-Fi. Turning it off briefly to get through a captive portal is an acceptable trade.
What to look for in a VPN's kill switch
- Firewall-based and on by default, not a reactive monitor that closes apps after the drop.
- Covers IPv6 and DNS, not only IPv4.
- Optional Lockdown or block-when-disconnected mode that survives quitting the app, a crash and a reboot.
- Documented TunnelVision and TunnelCrack mitigations, such as no automatic local-network or server-IP exceptions, or namespace isolation on Linux.
- Independent audits that tested leak behaviour. The Android connectivity-check leak was found in one.
- Per-platform notes. On iOS, check that the app enables includeAllNetworks, because apps may leave it off by default. On Android, check that the app supports always-on rather than opting out.
- Clear split-tunnel rules that say which exclusions stay open in Lockdown.
- Plan coverage. In our catalogue, 8 of the 22 services with a kill switch have a free plan or free version. Some limit the feature: Turbo VPN includes it only on premium, and Avira Phantom VPN only in Pro for Windows.
22 of 24 catalogue VPNs list a kill switch. Only 8 of those also have a free plan or version.
Tools that have it
From the directory, based on each tool's own feature list. Check the plan: some offer it only on paid tiers or certain apps.
- P
Proton VPNKill switch and always-on VPN · Free, from $3.49/mo
- N
NordVPNKill switch in VPN apps · From $2.99/mo - E
ExpressVPNInternet kill switch listed · From $2.99/mo - S
SurfsharkKill switch in VPN apps · From $2.49/mo - P
PureVPNInternet kill switch listed · From $1.69/mo - I
IPVanishKill switch in VPN apps · From $2.19/mo - P
PrivateVPNKill switch listed in features · From $2.40/mo - V
VeePNKill Switch listed in features · From $1.99/mo
- T
Turbo VPNKill Switch on premium · Free, from $3.33/mo
- A
Amnezia VPNKillSwitch listed in features · Free, from $3.30/mo - T
TunnelBearVigilantBear kill switch in apps · Free, from $3.33/mo - P
Private Internet AccessKill switch listed in features · From $2.03/mo - H
Hotspot ShieldKill switch in its VPN apps · Freemium - W
WindscribeFirewall acts as kill switch · Freemium - C
CyberGhostStandard kill switch in apps · From $2.19/mo - M
Mullvad VPNBuilt in kill switch in app · From $5.61/mo
- T
TorGuardNetwork lock kill switch in app · Paid - B
BetternetListed on old site, VPN app · Free, from $6/mo
- V
VyprVPNKill switch in VPN apps · Paid - V
VPN Proxy MasterAutomatic kill switch · From $3.70/mo
Show all 22
FAQ
Do I need a kill switch on my VPN?
If the point of the VPN is to hide your IP or DNS from the local network or your ISP, yes, because tunnels drop during handovers, sleep, timeouts and crashes. Without a block, traffic falls back to your real connection until the VPN reconnects.
Does the iPhone have a built-in VPN kill switch?
Not as a user setting. VPN apps can enable includeAllNetworks, and a system-level always-on block exists only through an always-on VPN profile on an MDM-supervised device.
Should I keep the kill switch on all the time?
A basic kill switch costs nothing while the tunnel is up, so leaving it on is the safe default. The trade-offs are no internet during reconnects and possible trouble with captive portals and LAN devices.
Is Mullvad's Lockdown mode the same as a kill switch?
No. Mullvad's desktop kill switch is always on while the app intends to be connected, and Lockdown mode also blocks traffic after you disconnect or quit. Split-tunneled apps keep internet access even in Lockdown mode.
Does a kill switch stop IPv6 leaks?
Only if its rules cover IPv6 as well as IPv4. The wg-quick man page warns that its iptables kill-switch rule needs matching ip6tables rules for IPv6.
Can a VPN leak even when the kill switch is on?
Yes. TunnelVision and TunnelCrack route traffic around the tunnel while the VPN still looks connected, and every OS exempts some traffic, such as Android Wi-Fi connectivity checks and Apple's DHCP and captive-portal traffic.
Cite this page
You are welcome to quote this entry and reuse its pictures with a link to this page.
Vovchyk, S. (2026, November 7). Kill Switch. capyrate Wiki. https://capyrate.com/wiki/kill-switch<a href="https://capyrate.com/wiki/kill-switch">Kill Switch, capyrate Wiki</a>