Skip to content

Lesson 4 of 9 · 23m

Split Tunneling Done Right

Route only the traffic that belongs to private networks while protecting DNS, policy, and user experience from the usual split-tunnel mistakes.

The full-tunnel corporate VPN made a simple promise: send everything through us and policy becomes easy. Then everyone moved to cloud SaaS, home bandwidth became better than office bandwidth, and the VPN concentrator became an expensive hairpin. Split tunneling is the rational answer, but only if you treat routing and DNS as security policy instead of performance hacks.

Split tunneling is a routing decision

In WireGuard, AllowedIPs on the client controls which destination prefixes enter the tunnel:

[Peer]
PublicKey = corp-gateway-public
Endpoint = access.sudosecurity.org:51820
AllowedIPs = 10.20.0.0/16, 10.44.0.0/16, fd44:20::/48

That configuration does not route general internet traffic through the gateway. It routes private application networks only. Do not add 0.0.0.0/0 unless you really intend full tunnel, including the bandwidth, abuse-handling, egress-IP, and privacy consequences.

DNS is where split tunneling becomes dangerous

If private routes go through the tunnel but DNS resolution still uses a public resolver, you leak internal names and receive wrong or split-horizon answers. If all DNS goes inside, users may lose local captive-portal resolution or regional CDN selection. You need explicit split DNS policy.

A systemd-resolved example:

resolvectl dns wg0 10.44.0.2
resolvectl domain wg0 '~internal.sudosecurity.org' '~10.in-addr.arpa'
resolvectl query db.internal.sudosecurity.org

The tilde means routing-only domains: queries for those suffixes use the tunnel resolver, while unrelated names continue through the normal system resolver. Test negative caching too; a wrong answer cached before tunnel connection can survive long enough to look like a routing failure.

Do not bypass security by accident

Split tunneling should not mean unmanaged direct access to sensitive SaaS admin planes, cloud metadata endpoints, or development systems. Policy often needs more nuance than "private inside, public outside." You may route high-risk SaaS through controlled egress for DLP or source-IP restrictions while letting ordinary browsing go direct.

Beware local network exceptions

Home networks, printer discovery, Chromecast, captive portals, and local file shares all create exceptions people expect to work. Blanket tunnel routes can break them, and users respond by disabling the VPN entirely. Document and test local-network behavior. Explicitly excluding RFC1918 space is not enough if internal RFC1918 routes overlap with the user's LAN.

Measure what users actually experience

Track tunnel latency, direct latency, DNS resolution time, captive portal failures, and application-specific flows. Users do not complain about AllowedIPs; they complain that "the VPN makes Teams slow." Your job is to prove which traffic should never have entered the tunnel.

Field notes

  • 0.0.0.0/1 and 128.0.0.0/1 are route tricks often used instead of 0.0.0.0/0; know whether your tooling intentionally uses them.
  • IPv6 can bypass a carefully designed IPv4-only tunnel. Either design IPv6 policy or deliberately disable/quarantine it.
  • Per-app split tunneling is platform-specific and fragile; do not promise it without testing managed devices.
  • DNS leaks are privacy and correctness failures, not merely compliance paperwork.

Was this lesson helpful?

Sign in to rate