WireGuard split tunneling explained

"Split tunneling" sounds complicated. In WireGuard it's a single config line: AllowedIPs. Here's exactly what that line does, and the four common patterns — full tunnel, LAN-only, subnet allow-list, and everything-except.

Disclosure: contains an affiliate link to Inferno VPS.

What AllowedIPs actually does

AllowedIPs appears in the [Peer] block of every WireGuard config. It has two simultaneous meanings:

  1. For inbound traffic from this peer: "I will accept packets with these source IPs as legitimate." Source IPs not in the list are dropped.
  2. For outbound traffic from this client: "I will route packets to these destination IPs through this peer." Destinations not in the list go through your normal default route, i.e. directly via the local network.

That second meaning is the routing decision that creates a split tunnel — or a full tunnel, depending on what you list.

Pattern 1 — Full tunnel (default)

Send everything through the VPN. The "give me a normal personal VPN" pattern.

[Peer]
PublicKey = ...
Endpoint = vpn.example.com:51820
AllowedIPs = 0.0.0.0/0, ::/0
PersistentKeepalive = 25

0.0.0.0/0 matches every IPv4 destination; ::/0 matches every IPv6 destination. Combined, all client traffic flows through the tunnel — including DNS, if you also set DNS = ... in the [Interface] block.

Pattern 2 — LAN-only (access internal resources from outside)

Connect to a home or office LAN remotely, but route public-internet traffic over the normal connection (no slowdown, no DNS routing).

[Peer]
PublicKey = ...
Endpoint = vpn.example.com:51820
AllowedIPs = 10.7.0.0/24, 192.168.1.0/24
PersistentKeepalive = 25

10.7.0.0/24 is the WireGuard tunnel subnet itself (so you can reach the server's WireGuard IP). 192.168.1.0/24 is the home LAN behind the server. Anything else (Google, GitHub, your bank) bypasses the VPN.

For the home LAN reachability to work, the VPS-side WireGuard server needs to be your home gateway or be routable to it — most commonly via a site-to-site tunnel, not a remote-access tunnel. For a small home setup, run WireGuard on a home machine (a Raspberry Pi works) and point the client's Endpoint at your home's public IP.

Pattern 3 — Specific subnets only

Useful when you want only certain services routed through the VPN — say, only your self-hosted apps that live on a specific cloud subnet:

AllowedIPs = 10.7.0.0/24, 172.16.0.0/12

10.7.0.0/24 covers the WireGuard tunnel. 172.16.0.0/12 covers a private cloud subnet. Everything else goes via your normal route.

Pattern 4 — "Full tunnel except a few subnets"

You want a full VPN, but specific destinations must bypass it: a local printer, a streaming service that geo-blocks the VPN's IP, a bank that flags VPN access.

WireGuard's config syntax doesn't have a built-in "exclude" — but the trick is to enumerate every subnet except the excluded ones. Convenient online tools do the math; the result for "0.0.0.0/0 except 192.168.1.0/24" is approximately:

AllowedIPs = 0.0.0.0/1, 128.0.0.0/2, 192.0.0.0/9, 192.128.0.0/11, 192.160.0.0/13, 192.169.0.0/16, 192.170.0.0/15, 192.172.0.0/14, 192.176.0.0/12, 192.192.0.0/10, 193.0.0.0/8, 194.0.0.0/7, 196.0.0.0/6, 200.0.0.0/5, 208.0.0.0/4, 224.0.0.0/3

Hard to read; easy to generate. Search for "WireGuard AllowedIPs calculator" and feed it your exclusions. Re-generate when you change the exclusion list.

Per-app split tunneling (only on Android)

WireGuard's AllowedIPs works at the IP layer — it can route by destination, not by application. The one platform where you can split by app is Android, via the WireGuard app's "Excluded applications" feature (see client setup).

On other platforms, per-app routing requires a different VPN client (Tailscale, third-party tools) or OS-level firewall rules — out of scope for WireGuard alone.

DNS in a split tunnel

When AllowedIPs = 0.0.0.0/0, the DNS = line in [Interface] takes effect and queries flow through the tunnel. In a split tunnel (anything narrower than 0.0.0.0/0), DNS behavior depends on the platform:

Test with dnsleaktest.com after every config change.

Server-side: allowing access to private subnets

If clients are routed to a LAN behind the WireGuard server, the server needs to know how to forward that traffic. Two things must be true on the server:

  1. IP forwarding is enabled (net.ipv4.ip_forward = 1) — same setting our install guide sets.
  2. The peer's AllowedIPs on the server side includes only the IPs that peer should be allowed to claim — never 0.0.0.0/0, which would let any client steal traffic from any other.
# Server-side wg0.conf — note the difference in meaning vs client
[Peer]
# This client gets exactly 10.7.0.2
PublicKey = <client_public_key>
AllowedIPs = 10.7.0.2/32

Site-to-site tunneling

The split-tunnel patterns above generalize to site-to-site: two networks linked through WireGuard, each able to reach the other's subnets. Both ends list each other's networks in AllowedIPs:

# Site A (10.7.0.1, fronts LAN 192.168.1.0/24)
[Peer]
PublicKey = <site_b_public_key>
Endpoint = site-b.example.com:51820
AllowedIPs = 10.7.0.2/32, 192.168.2.0/24
PersistentKeepalive = 25

# Site B (10.7.0.2, fronts LAN 192.168.2.0/24)
[Peer]
PublicKey = <site_a_public_key>
Endpoint = site-a.example.com:51820
AllowedIPs = 10.7.0.1/32, 192.168.1.0/24
PersistentKeepalive = 25

Apply the same firewall and IP-forwarding requirements as for a remote-access tunnel. The setup scales to a small mesh (3-5 sites); beyond that, look at Tailscale or a routing daemon.

Common split-tunnel mistakes

"Some sites I expected to bypass the VPN go through it anyway"

Your AllowedIPs includes a wider subnet than you think. 192.168.0.0/16 covers a much larger range than 192.168.1.0/24.

"DNS leaks even though traffic looks right"

The client's OS is using its system resolver instead of the tunnel's. Either remove the DNS = line and accept system resolution, or use a full tunnel for DNS-sensitive workflows.

"Local printer / Chromecast stopped working with VPN on"

You're on a full tunnel that includes 0.0.0.0/0. Exclude the local subnet via Pattern 4 above, or temporarily disable the VPN for printing.

"Site-to-site tunnel works one way only"

The reverse-direction AllowedIPs doesn't include the remote LAN, or IP forwarding isn't enabled on the side that's failing. Both sides need the equivalent settings.

VPS for a site-to-site WireGuard mesh?

Each WireGuard endpoint is tiny — fits on the cheapest plan. Inferno's eight locations are useful when you want each side of a mesh in a different jurisdiction.

View Inferno locations →

What to do next


Author: Riku Lehtinen — Tampere. Last reviewed: 2026-05-22 against real configs running in production.