UniFi · Networking
Route devices and VLANs through a VPN provider on UniFi — the traffic-route fix
The VPN client shows connected, yet the devices you meant to protect still appear on the ordinary internet connection. That is not a broken tunnel — it is a missing route.
Ubiquiti states the rule plainly: traffic is not automatically sent over the VPN. A traffic route is what sends it.
The fast answer
Do not keep reconnecting the tunnel. The tunnel is probably fine. After the VPN client connects, add a traffic route (a policy-based route) that names the source — a device, a device group, or a whole VLAN — and sends it through the VPN interface. Then decide the kill-switch question deliberately: if the tunnel drops, should that traffic stop entirely, or fall back to the normal line? The wrong answer there either leaks traffic or causes a confusing outage.
What you are looking at, in plain words
A UniFi VPN client connects your gateway to a commercial VPN provider — the opposite direction from a VPN server, which lets remote users into your network. The client is set up by uploading the provider's configuration file and entering credentials, and the connection then establishes automatically. So far, so simple — and so useless, on its own. Ubiquiti's OpenVPN Client documentation says it directly: traffic from devices is not automatically sent over the VPN; to send traffic from devices over the VPN, add a Traffic Route.
A traffic route (also called a policy-based route) is a rule with a source, a destination, and an interface: traffic matching the source and destination goes out through the interface you name — here, the VPN tunnel. Sources can be any traffic, specific networks or VLANs, or specific devices. Destinations can be any address, specific IPs, or domains (domain rules require the clients to use the UniFi gateway as their DNS server). That is the whole mechanism: tunnel first, route second, and the route is what actually moves traffic.
One detail from the same documentation is worth knowing before you start: your VPN provider login credentials may not be the same as the credentials used for authentication — check with the provider which username and password the tunnel actually needs.
Step 0 — Prove which part is failing
Before routing anything, prove the tunnel itself works. Connect the VPN client, confirm it shows connected, and note which provider server and protocol you used. Then check one unrouted device's public address (it should still be the normal line) — that baseline is what you will compare against after the route. If the tunnel will not connect at all, fix the configuration file and credentials first; no route can rescue a tunnel that is down.
The fixes, in order
- Set up the VPN client. In the console's VPN section, create a VPN client for your provider. For OpenVPN, upload the configuration file the provider supplied and enter the authentication credentials — remembering they may differ from your provider login. For WireGuard, use the provider's WireGuard configuration instead. Apply the change and confirm the client connection establishes.
- Add a traffic route for one test source. Add a traffic route (policy-based route) with the VPN tunnel as its interface, and a narrow source: one test device, or one VLAN you can afford to experiment with — not the whole office. Set the destination to any traffic for a first test. Apply the route.
- Decide the kill-switch behaviour before you need it. On the route, decide the kill-switch toggle deliberately. Enabled: if the VPN interface goes down, that traffic stops completely — nothing leaks onto the normal line, but the routed devices lose internet until the tunnel recovers. Disabled: traffic falls back to the default line — devices stay online, but they are no longer on the VPN. For privacy-sensitive traffic, enabled is the honest choice; for a guest VLAN, disabled may be kinder. Record which you chose and why.
- Prove the route, device by device. From the routed test device, check its public address: it should now be the VPN provider's address, while an unrouted device still shows the normal line. Browse, stream, and use one business service from the routed device. If the address has not changed, the route is not matching that device — re-check the source (device, group, or VLAN) rather than reconnecting the tunnel.
- Widen slowly, watching for VPN-unfriendly services. Only once the test source works, widen the route to the full VLAN or device group you intended. Then use the services the business actually needs from a routed device — banking, cloud apps, video calls — because some services treat VPN addresses with suspicion and will challenge or block them. If a critical service breaks on the VPN, narrow the route (exclude that service's destination, or that device) instead of abandoning the whole setup.
Prove it worked
Two checks, side by side: a routed device shows the VPN provider's address and an unrouted device shows the normal line, at the same time. Then disconnect the VPN client briefly (in a quiet moment) and confirm the kill-switch behaviour you chose actually happens — traffic stops, or traffic falls back — rather than discovering it during a real tunnel outage.
Still not working? Work this ladder in order
- Tunnel connected, routed device address unchanged: the traffic route is missing or its source does not match the device. Re-check the route's source and interface; do not reconnect the tunnel.
- Tunnel will not connect: re-check the configuration file and the authentication credentials (which may differ from the provider login). Ask the provider which credentials the tunnel needs.
- Routed traffic stops entirely: the tunnel is down and the kill switch is doing its job. Restore the tunnel, or — deliberately — change the kill-switch setting if fallback is acceptable for this traffic.
- Some services break only on routed devices: those services dislike VPN addresses. Narrow the route for those destinations or devices instead of routing everything.
- Everything is slow on the VPN: the provider's server may be distant or busy. Try another provider server before blaming the gateway.
- 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
- Assuming a connected tunnel routes traffic by itself.
- Routing the whole office through the VPN before testing one VLAN.
- Using provider login credentials where the tunnel needs different authentication credentials.
- Leaving the kill-switch choice unmade — then discovering it during an outage.
- Blaming the gateway for a provider server that is slow or distant.
FAQ — the issues behind this problem, answered
Why is my VPN connected but my devices still show my normal address?
Because connecting the client only builds the tunnel. Ubiquiti states that traffic is not automatically sent over the VPN — you must add a traffic route naming the devices or VLANs that should use it.
What happens to routed traffic if the VPN tunnel drops?
It depends on the route's kill-switch toggle. Enabled, the traffic stops completely. Disabled, it falls back to the default line. Choose per route, and test it, rather than discovering the behaviour during an outage.
Can I route just one VLAN through the VPN and leave the rest normal?
Yes — that is exactly what traffic routes are for. Name the VLAN as the route's source and the VPN tunnel as its interface; other VLANs keep using the normal line.
Sources
Ubiquiti Help Center — UniFi Gateway – OpenVPN Client (traffic is not sent automatically; add a Traffic Route; provider login vs authentication credentials) · UniFi Gateway – Policy-Based Routing (route sources, destinations, and the kill-switch toggle).
Did this fix work for you?
Your reaction is stored only in your own browser — it is not sent to us.