Remote Support Start download

OPNsense WireGuard with Split Tunneling: Only the Right Routes Through the Tunnel

OPNsenseWireGuardVPN
OPNsense WireGuard with Split Tunneling: Only the Right Routes Through the Tunnel

Full-tunnel VPNs were the standard for years: everything runs through the firewall, including the employee’s private Netflix stream at home. With more cloud workloads, long-term remote teams and video calls that work better locally, split tunneling has become the sensible default. The problem: it is where most WireGuard rollouts stumble. This article is the follow-up to our introduction on WireGuard on OPNsense and explains what matters once only part of the traffic should go through the tunnel.

Short version: Split tunneling means the WireGuard client only writes routes for the company subnets into its routing table. Everything else — internet, SaaS, streaming — bypasses the tunnel. Technically it is controlled by AllowedIPs on the client. On top of that: DNS splitting and the client mechanics on iOS, Android, Windows and Linux. The OPNsense configuration stays largely the same as for a full tunnel.

What Split Tunneling Really Is With WireGuard

WireGuard has no dedicated split-tunneling concept. The protocol only knows AllowedIPs per peer. On the server side, this controls which source IPs the server interface accepts for that peer. On the client side, AllowedIPs additionally controls the routes the client writes into its routing table.

If the client sets AllowedIPs = 0.0.0.0/0, ::/0, all IPv4 and IPv6 traffic goes through the tunnel — the classic full tunnel. If instead only company subnets are listed, for example AllowedIPs = 10.10.0.0/16, 192.168.50.0/24, only that traffic is routed through. Everything else goes out over the local internet. No OPNsense setting changes that — split tunneling is purely a client decision.

What That Means for Firewall Logic

OPNsense sees the company traffic on the WireGuard interface in both cases, and the firewall rules apply unchanged. What disappears is control over the employee’s internet traffic. For GDPR that is usually an advantage; in regulated industries (finance, critical infrastructure) it has to be a conscious design choice.

Setting AllowedIPs Correctly: The Routes That Really Need the Tunnel

A typical SMB list has three to five subnets: server VLAN, client VLAN, maybe management VLAN, IoT segment, and the hyperscaler network with the mail server or ERP. A typical client-side AllowedIPs line:

AllowedIPs = 10.10.10.0/24, 10.10.20.0/24, 10.10.90.0/24, 10.20.0.0/16

Server VLAN with file servers and ERP, client VLAN for printers and internal services, admin-only management VLAN, Azure VNet with the Exchange tenant. Everything else — browsing, Teams calls, M365, backup agents — bypasses the tunnel.

Common Pitfalls With AllowedIPs

Three mistakes come up regularly:

  • Masks that are too broad. AllowedIPs = 10.0.0.0/8 routes every 10.x.x.x network through the tunnel. Many employees are on 10.x networks at home — it kills the local LAN connection to printer and NAS. Stick to the /24 or /16 subnets that actually belong to the company.
  • Missing the DNS target. If the internal DNS server lives at 10.10.10.10, the subnet 10.10.10.0/24 must be part of AllowedIPs. Otherwise the client cannot reach DNS.
  • Overlap with home networks. Companies on 192.168.1.0/24 run into trouble eventually — every home router hands out that range. Move internal networks to non-trivial ranges (for example 10.42.17.0/24).

AllowedIPs on the Server Peer

On the server side, each client peer gets its tunnel IP, for example AllowedIPs = 10.80.0.5/32. That line has nothing to do with split tunneling — it only defines which source IP a peer may use.

DNS Splitting: Where Most Setups Fail

Split tunneling without a thought-out DNS story ends in one of two ways: the employee cannot resolve internal hosts because public DNS does not know the company domain, or the internal DNS server ends up handling all public queries. Both are avoidable.

Option 1: Two DNS Servers on the Client

The simplest approach: on the WireGuard client, add two DNS servers, internal first (10.10.10.10), public second (1.1.1.1). Works, but clients often query both in parallel and the faster wins — the public DNS can return NXDOMAIN before the internal one has even answered. Internal names then stop working.

Option 2: Split DNS Through the WireGuard Config (Preferred)

The modern WireGuard clients let you specify DNS server and search domains together:

DNS = 10.10.10.10, intern.example.com

The client queries the internal DNS server only for names inside intern.example.com. Everything else goes to the OS resolver. Cleanest setup, resolves 90 percent of DNS problems with split tunneling. Supported reliably on iOS, macOS, Android and Windows; on Linux it depends on the resolver.

Internal Resolver on OPNsense: Unbound and Views

If internal DNS runs on OPNsense itself, use Unbound. For split-tunneling clients, add a dedicated Unbound view on the WireGuard interface that only resolves the internal zones and returns REFUSED for everything else. Configuration under Services -> Unbound DNS -> Advanced with tailored access-control and local-zone entries.

Client Configuration: iOS, Android, Windows, Linux

WireGuard clients differ in details that matter for split tunneling. A practical overview from our SMB rollouts.

iOS and iPadOS

The official WireGuard app supports split tunneling fully, including AllowedIPs, DNS and search domains. From iOS 17, split DNS with search domains works reliably. Best practice: distribute the tunnel configuration as a profile through MDM (Jamf, Intune, Mosyle), together with an on-demand rule that activates the tunnel automatically outside the office Wi-Fi. That cuts support calls significantly.

Android

The WireGuard app from the Play Store (or F-Droid) supports the same feature set as iOS. Plus one unique feature: per tunnel, you can allowlist or blocklist specific apps. For example, only ERP and browser through the tunnel, Teams and Zoom bypass it. In BYOD, a real gift — the private browser traffic never touches the company.

Windows

The official Windows client supports split tunneling and split DNS with search domains from version 0.5. For enterprise rollouts, the MSI package pushed through GPO or Intune is the way. One quirk: it installs as a DNS policy in the system resolver and can conflict with other VPN clients (for example a legacy OpenVPN). Test before you roll out.

Linux

Two main paths: classic wg-quick with .conf files in /etc/wireguard/, or NetworkManager integration. For servers and admin workstations, wg-quick is the clean choice. For employee laptops on Ubuntu or Fedora, NetworkManager plays nicer with systemd-resolved. With wg-quick, the DNS line is applied through resolvconf or openresolv — depending on the distribution, a small PostUp/PostDown hook is needed to inject the search domain.

OPNsense-Side Specifics

The server itself needs little change, but a few points are worth noting:

  • NAT: Full tunnel needs outbound NAT on the WAN; with split tunneling, outbound NAT is only still needed for company traffic going to, say, your Azure zone. The NAT setup can get leaner.
  • Firewall rules on the WireGuard interface: Same principles as full tunnel. Default deny stays the base rule.
  • Floating rules for logging: For session logs on OPNsense, add a floating rule with the log flag on the WireGuard interface. Same principles as in our article on network segmentation with VLANs on OPNsense.

When Split Tunneling Is Not the Right Choice

Some scenarios still call for a full tunnel:

  • Regulated environments. When employee internet traffic has to be centrally logged, filtered or DLP-inspected.
  • Zero-trust designs with central egress. When all traffic has to go through a single, central egress point — use full tunnel or ZTNA/SASE.
  • Central content filtering. When malware or content filtering is only on the firewall, split tunneling removes that protection for home-office users.

In practice this is the minority. For most SMBs with M365, local ERP and an internal file server, split tunneling is the more efficient and user-friendly model.

FAQ

What is the difference between full tunnel and split tunneling with WireGuard?

With full tunnel, all client network traffic goes through the WireGuard tunnel; with split tunneling, only connections to defined company subnets. Technically this is controlled through the AllowedIPs setting on the client.

How do I configure DNS so that both internal and external names work?

The cleanest way: in the WireGuard peer configuration, specify the internal DNS server together with a search domain, for example DNS = 10.10.10.10, intern.example.com. The client then only queries the internal DNS for the company domain; everything else goes to the standard resolver.

Which operating systems support split DNS with WireGuard?

iOS 15+, Android, Windows WireGuard client 0.5+ and macOS support split DNS reliably. On Linux it works cleanly with systemd-resolved, less cleanly with resolvconf unless additional hooks are in place. For employee laptops, NetworkManager is usually the best choice.

What happens if AllowedIPs on the client is set too broadly?

If the client uses AllowedIPs = 10.0.0.0/8, every 10.x destination ends up in the tunnel. That can kill the connection to printers, NAS or home router if they themselves live in a 10.x range. Use precise /24 or /16 networks that actually belong to the company.

Is split tunneling a GDPR risk?

For GDPR, split tunneling is usually an advantage because the employee’s private internet traffic never touches the company. In regulated industries (finance, critical infrastructure, healthcare) there may be a logging obligation that forces full tunnel. Clarify with the data protection officer before rolling out.

Can I switch an existing tunnel to split tunneling later?

Yes. It is a client-side change — OPNsense needs no modification. Replace the existing client configurations with new ones that carry adjusted AllowedIPs and DNS entries. Usually rolled out through MDM or GPO; a fresh QR-code set is enough for small teams.

Our Recommendation

For new remote-access setups on OPNsense we recommend split tunneling in more than 80 percent of SMB projects. The upsides — offloaded firewall, better video-call latency, clean separation of private and work traffic — usually outweigh the downsides. Three things decide whether it works: precise AllowedIPs, a well-designed DNS concept with a search domain, and a tested client rollout.

DATAZONE helps with the design, the implementation on OPNsense and the client rollout — MDM, GPO or manual. If you already run TrueNAS as an internal file server, a one-day workshop is usually enough to end up with a clean setup.


Looking to move your WireGuard setup to split tunneling, or build one from scratch? Get in touch for a no-strings consultation.

More on these topics:

Need IT consulting?

Contact us for a no-obligation consultation on Proxmox, OPNsense, TrueNAS and more.

Get in touch