A kill switch stops traffic from going around the VPN. Split tunnelling deliberately lets some traffic go around it. WireGuard can do both, but the method differs on each system.
In a client configuration, AllowedIPs under [Peer] lists the destinations sent to that peer.
| AllowedIPs | Effect |
|---|---|
0.0.0.0/0, ::/0 | Full tunnel for IPv4 and IPv6 |
10.0.0.0/24 | Only that private network uses the VPN |
0.0.0.0/0 alone | IPv4 tunnelled; IPv6 keeps its normal route |
The addresses above are examples. A split tunnel is not a privacy mode: everything outside the list uses your normal connection and real IP address. Check DNS too. If the configured DNS server is outside the listed ranges, lookups may not go through the tunnel.
Warning: do not enable a full tunnel or kill switch on a remote machine you manage over SSH unless you have console access. You can cut off your own session.
In the official WireGuard app, edit the tunnel. With a single peer and a /0 entry in AllowedIPs, the editor offers a checkbox, Block untunneled traffic (kill-switch). It adds firewall rules that block traffic outside the tunnel, with narrow exceptions such as DHCP. If the configuration sets DNS servers, port 53 traffic is allowed only to them.
Side effect: printers, file shares and other devices on your local network may stop working. Unticking the box changes the routes to 0.0.0.0/1, 128.0.0.0/1 (and ::/1, 8000::/1 for IPv6). Nearly everything still goes through the VPN, but the strict blocking is gone.
For split tunnelling, list only the networks you want, for example AllowedIPs = 10.0.0.0/24. This selects by destination address, not by program, and the kill switch does not apply without a /0 entry.
The wg-quick manual gives a firewall-based kill switch. This version covers IPv4 and IPv6; add the lines under [Interface] in /etc/wireguard/wg0.conf, with a full tunnel in AllowedIPs:
PostUp = iptables -I OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL -j REJECT
PostUp = ip6tables -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
PreDown = ip6tables -D OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL -j REJECTIt rejects outgoing packets that are neither going into the tunnel nor part of the encrypted WireGuard connection itself.
This also blocks your local network. To allow it, add these two lines after the ones above, changing the range to yours:
PostUp = iptables -I OUTPUT -d 192.168.1.0/24 -j ACCEPT
PreDown = iptables -D OUTPUT -d 192.168.1.0/24 -j ACCEPTLimits worth knowing:
sudo systemctl enable wg-quick@wg0 starts it at boot, but there can still be a gap before that.wg-quick down removes them, so a deliberate disconnect restores normal access.For split tunnelling, narrow AllowedIPs and leave out the kill switch lines. To choose by application, WireGuard's documentation describes using network namespaces, which is more advanced.
Per-app split tunnel: in the WireGuard app, edit the tunnel and open the applications selection. You can either exclude chosen apps from the VPN or include only chosen apps. You cannot combine both lists. In configuration text these are ExcludedApplications or IncludedApplications under [Interface].
Kill switch: this is an Android system feature. Open Settings, Network & internet, VPN, tap the settings icon next to WireGuard, then turn on Always-on VPN and Block connections without VPN. Names and menu positions vary between phone makers.
Two things surprise people. With blocking on, apps you left out of the VPN can lose their connection entirely, so exclusions and strict blocking do not mix well. And Mullvad has reported that Android sends some connectivity checks outside the VPN even with this setting on, so do not treat it as absolute.
sudo wg show on Linux, or the app's tunnel details).curl --interface eth0 https://api.ipify.org. With the kill switch working, it should fail.ip route get for an address inside and outside the range on Linux.If you lose all connectivity, deactivate the tunnel (Windows, Android) or run sudo wg-quick down wg0 (Linux). A captive portal on hotel Wi-Fi often needs you to sign in before the VPN can connect.
For the other end, see WireGuard on a VPS. You can run it on our VPS plans with root access, for lawful use within the acceptable use policy.
Do I need a kill switch with a split tunnel?
A strict kill switch conflicts with split tunnelling, because it blocks the traffic you meant to leave outside. Decide which matters more for that device.
Why did my printer disappear after enabling the kill switch?
Local network traffic is being blocked along with other non-tunnel traffic. On Linux you can allow your local range; on Windows you can untick the blocking option, accepting weaker protection.
Does the kill switch stop DNS leaks?
It helps by blocking traffic outside the tunnel, but you should still set a DNS server and test. Browser encrypted DNS and allowed local ranges can change where lookups go.
Can WireGuard on Windows exclude one application?
The official configuration splits by destination address, not by program. Per-app selection is available in the Android app.