UniFi networking

UniFi · WireGuard VPN

UniFi WireGuard VPN connects but you cannot reach the LAN: the tunnel-up, LAN-down fix

First published 27 October 2026 · Updated on 12 November 2026 · Verified against Ubiquiti Help Center documentation (sources listed below)

Merroway Editorial · Verified against governing standards and vendor documentation.

The fast answer

Do not rebuild the VPN server or re-issue every client config yet. Open the client configuration file and read its AllowedIPs line first. That line is the client’s routing table: WireGuard only sends traffic for the listed addresses through the tunnel. If your office LAN subnet is not listed (and you are not using a full tunnel), the client sends LAN traffic out its normal internet connection instead — where it goes nowhere. Add the LAN subnet to AllowedIPs, re-import the config, and re-test before touching the firewall.

Advertisements

What you are looking at, in plain words

A UniFi WireGuard server runs on the gateway: you enable it, choose a port (UDP 51820 by default), add a client, and share that client’s configuration file or QR code. The client’s file carries keys, a tunnel address, DNS, the gateway address, and AllowedIPs. “Tunnel up” means the encrypted link works. “LAN reachable” additionally needs the client to route LAN addresses into the tunnel, the gateway’s firewall to allow VPN-zone traffic into the internal networks, and the target device to accept the connection. This guide tests those three layers in order, so you fix the broken one instead of all three.

Step 0 — Prove which part is failing

  1. Confirm the tunnel really is up. The WireGuard client should show a recent handshake and transferred data. No handshake means the client never reached the gateway at all — that is a different problem (port, address, or CGNAT; see step 3), not a LAN-routing problem.
  2. Ping the gateway’s VPN address, then a LAN address. If the VPN address answers but the LAN address does not, the tunnel works and the LAN path does not. If neither answers, suspect the client config or the gateway itself before the LAN.
  3. Ping by IP address, not by name. Name resolution failing while IP ping works is a DNS problem, not a routing problem. Fix DNS separately instead of rebuilding routes.
  4. Note the exact LAN subnet you are trying to reach (for example 192.168.1.0/24) and the client’s own local subnet. If both are the same subnet, the client’s own network wins and LAN traffic never enters the tunnel — that overlap, not the VPN, is the fault.

The fixes, in order

  1. Fix AllowedIPs on the client. Open the client configuration file before importing it. For a split tunnel, the line must list the networks you need, for example AllowedIPs = 192.168.1.0/24 (plus any other VLAN subnets, comma-separated, and the VPN subnet if your setup requires it). For a full tunnel, it is AllowedIPs = 0.0.0.0/0 (plus ::/0 for IPv6 if used). Edit the line, save, and re-import the config — editing a file already imported does not change the live tunnel. Re-test with a ping to a LAN IP.
  2. Check the firewall zone path. On gateways running the Zone-Based Firewall (UniFi Network 9.0 and newer), WireGuard users land in the VPN zone, and the built-in default from the VPN zone to the Internal zone is Allow All. If you (or a migration) added custom policies, check them: a policy blocking VPN → Internal, or a network assigned to the wrong zone, will silently drop exactly this traffic. Test by temporarily noting — not permanently deleting — which custom policy sits above the built-in allow, and correct its source/destination zones.
  3. Check the WAN side only if the tunnel itself is flaky or never connects. If the gateway is behind another router, that router must forward UDP 51820 (or your chosen port) to the gateway’s WAN address — Ubiquiti’s own WireGuard guide states this directly. If the gateway’s WAN address falls in 100.64.0.0/10 (100.64.0.0 to 100.127.255.255), you are behind CGNAT and inbound WireGuard connections cannot reach you; ask your ISP for a public IP, or use Teleport instead (see the companion guide: UniFi Teleport will not connect or drops).
  4. Fix a stale endpoint after a WAN IP change. A client file points at the gateway’s WAN address at creation time. If your ISP changes that address, a client that is not already connected cannot reach the gateway until its file is updated. Regenerate the affected client configs.
  5. Fix a subnet overlap on the client side. If the remote worker’s home network uses the same subnet as the office LAN (both 192.168.1.0/24 is the classic case), traffic for the office printer is routed to the home network instead. Change one side: the clean fix is renumbering the smaller network, or giving the remote worker a different home subnet. No VPN setting overcomes an exact overlap.

Do not fix the wrong thing first: do not open the firewall wide to “test”. Deleting VPN-zone policies or allowing everything from the VPN zone to every network may restore access — and silently grant every remote device access to cameras, servers, and management interfaces it should never reach. Test one policy at a time, note what you changed, and restore least-privilege rules once the broken policy is identified.

Prove it worked

From the connected client, ping a LAN device by IP address, then open a real resource on it (a shared folder, printer page, or internal web page — not just a ping). Repeat from a second client profile if you changed a shared setting, to confirm you fixed the server side and not one laptop. Finally, confirm the client can still reach the internet normally (split tunnel) or through the office gateway (full tunnel), whichever you intended.

Still not working? Work this ladder in order

  1. Tunnel up, gateway VPN address answers, LAN does not. Recheck AllowedIPs and the VPN → Internal policies. One of them is still wrong.
  2. Tunnel up, LAN answers by IP but not by name. DNS: point the client at the gateway or an internal DNS server that knows LAN names, and confirm the client’s DNS setting survived re-import.
  3. Some LAN devices answer, others do not. The silent ones may sit on a different VLAN/subnet not listed in AllowedIPs, or behind their own host firewall that blocks non-local subnets. Add the missing subnet, or allow the VPN subnet on that device.
  4. Works on mobile data, fails on one Wi-Fi network. That network likely overlaps the office subnet, or its own firewall blocks VPN traffic. Test from a phone hotspot to isolate it.
  5. Nothing connects at all, on any client. Stop diagnosing LAN routing: you have a reachability problem. Check UDP 51820 forwarding, the WAN address class (CGNAT?), and whether the endpoint in the client file is still current.
  6. None of these steps fixes it. Take the results of Step 0 and the failing step above to Ubiquiti Support via the Ubiquiti Help Center (the official documentation linked in Sources above) — that is the next step, not a different vendor's forum thread.

Mistakes that make it worse

  • Editing an imported client config file and expecting the live tunnel to change.
  • Adding 0.0.0.0/0 to “fix” a split-tunnel problem, then wondering why all internet traffic now exits through the office.
  • Deleting firewall policies instead of identifying the one blocking VPN → Internal traffic.
  • Sharing one client config between several devices, so two peers claim the same tunnel address.
  • Assuming a “Connected” badge means LAN access is proven.
Advertisements

FAQ — WireGuard LAN access, answered

The tunnel shows connected. Does that prove the VPN works?

No — it proves only that the client and gateway completed a WireGuard handshake. Reaching a LAN device needs three more things: a client route to the LAN subnet, a firewall path from the VPN zone to the internal networks, and a LAN device that answers. Test each separately.

Should I use a full tunnel (0.0.0.0/0) or a split tunnel?

Use a split tunnel that lists only the networks the remote device needs, unless you specifically want all traffic (including internet browsing) to exit through the office gateway. A full tunnel is the right choice on untrusted public Wi-Fi; a split tunnel is the right default for reaching office resources, and it keeps unrelated traffic off the tunnel.

My gateway sits behind my ISP router. Is that a problem?

Only for the first connection, not for LAN reach once connected. If the gateway is behind NAT, the upstream router must forward UDP 51820 (or your chosen WireGuard port) to the gateway’s WAN address. If the WAN address is in the CGNAT range 100.64.0.0/10, inbound connections cannot reach you at all — that is an ISP limitation, not a UniFi setting.

Sources

Ubiquiti Help Center — UniFi Gateway – WireGuard VPN Server (UDP 51820 default, client config/QR flow, upstream forwarding requirement, public-IP recommendation) · Zone-Based Firewalls in UniFi (VPN zone, zone matrix defaults including VPN → Internal) · RFC 6598 (Shared Address Space 100.64.0.0/10 — the CGNAT range 100.64.0.0–100.127.255.255) · WireGuard (Cryptokey Routing: AllowedIPs as a routing table; 0.0.0.0/0 as the full-tunnel wildcard) · Companion guide: UniFi Teleport will not connect or drops.

Verification note: port, forwarding, CGNAT-range, and zone-matrix values on this page were re-checked against the Ubiquiti Help Center pages above, RFC 6598, and WireGuard's own protocol description on 12 November 2026. The UID troubleshooting page cited in earlier drafts was not re-fetched in full and is no longer cited here. AllowedIPs examples use the reader’s own LAN subnets; no reader-specific network values are asserted here.