Ubiquiti · VPN

UniFi gateways: VPN connection or routing failures

Ubiquiti's gateway VPN options are Teleport, WireGuard and legacy types. Teleport is a zero-configuration VPN: enable it under Network Settings, VPN on a Next-Gen or Cloud Gateway running UniFi OS, generate an invitation, and share it. If the recipient already has the WiFiman mobile or desktop app the invitation adds the VPN automatically, and if not it prompts them to install it.

An invitation expires in 24 hours and works for one device at a time.

Teleport can require an IPv6 connection on the gateway's WAN in some circumstances, and it need not be enabled on the LAN. Ubiquiti's FAQ says Teleport can be used when the gateway is behind NAT. WireGuard is the alternative for site to site and client connections, with its own server and client articles.

Ubiquiti recommends WireGuard or Teleport instead of UPnP or port forwarding for reaching devices at home.

If a VPN will not connect, check the invitation has not expired, that the app is current, that the WAN has a route out, that a double NAT is not blocking WireGuard's port and that the client's network allows the traffic. Revoke access from the VPN page when someone no longer needs it. Decide who needs access and for how long.

A Teleport invitation for a family member or contractor should be revoked when the need ends, and a WireGuard peer should be removed the same way.

Use a strong, unique credential where a credential is involved, and keep the gateway updated, since a remote-access feature is the part of the network most exposed to the internet. Test from a different network, not from inside the house, and note the round trip time. If the VPN connects but shows no traffic, check the allowed routes and that the remote device is not also using another VPN, since two tunnels on one device commonly conflict.

Model compatibility: Device coverage
ScopeCovered or excluded
ConditionVPN client or server will not connect

Differential

UniFi gateways: compare the causes

  1. 1

    An expired invitation

    What separates it.

    You cannot add the VPN because the invitation has expired

    How to confirm.

    Generate a new invitation, and use it within twenty four hours

  2. 2

    A missing IPv6 WAN

    What separates it.

    Teleport will not connect because the WAN does not have IPv6 enabled

    How to confirm.

    Enable IPv6 on the WAN, if your provider supports it, and try again

  3. 3

    Double NAT

    What separates it.

    WireGuard is unreachable because there is a double NAT in front of the gateway

    How to confirm.

    Fix the double NAT first, since inbound connections cannot pass through two routers

  4. 4

    An old app

    What separates it.

    The invitation fails because the WiFiman app on the phone is out of date

    How to confirm.

    Update the WiFiman app to the newest version, and accept the invitation again

  5. 5

    An old gateway

    What separates it.

    The feature is missing because the gateway runs an old version of UniFi OS

    How to confirm.

    Update UniFi OS, so that the VPN features are available on your gateway

Record before making changes

UniFi gateways: observations

  • Which type of VPN you are trying to use
  • The exact error message that the app shows
  • The WAN address and IPv6 state
  • Whether the gateway is behind NAT
Completed: 0 / 7
  1. Open VPN

    Open the VPN settings, which are under Network Settings and then VPN in the application.

  2. Enable Teleport, or WireGuard, depending on which type of VPN you want to use.

  3. Create an invitation, and share it once, with the person or device that will use it.

  4. Install WiFiman

    Install WiFiman on the device, and accept the invitation from inside the app.

  5. Check IPv6

    Check IPv6 on the WAN if it is needed, since Teleport can need it in some situations.

  6. Test remotely, by connecting on mobile data instead of your home wifi.

  7. Revoke when done

    Revoke access when it is no longer needed, from the VPN page in the application.

Model-specific

UniFi gateways: model limits

Support

Teleport needs a Next-Gen gateway or UniFi Cloud Gateway running UniFi OS.

Legacy

Older gateways offer L2TP and other legacy VPNs.

Stop boundary

UniFi gateways: service criteria

  • !

    If Teleport fails with a valid invitation and IPv6, contact Ubiquiti support

  • !

    If WireGuard fails behind carrier NAT, use Teleport or get a public address

  • !

    If the feature is missing, check the gateway type

References

Exact questions

UniFi gateways: common questions

What is Teleport?+

Teleport is a zero configuration VPN that is powered by WireGuard.

How long does an invitation last?+

An invitation lasts twenty four hours, so use it within that time.

How many devices per invitation?+

One device can use an invitation at a time, so create one for each device.

Does Teleport need IPv6?+

In some circumstances Teleport needs IPv6 on the WAN, so check that if it will not connect.

Can it work behind NAT?+

Yes, it can work behind NAT, according to Ubiquiti.

What app is needed?+

You need the WiFiman app on the device, to accept the invitation and connect.

Can I revoke access?+

Yes, you can revoke access at any time, from the VPN page in the application.

Is WireGuard available?+

Yes, WireGuard is available as an option, alongside Teleport.

Is a VPN better than port forwarding?+

Ubiquiti recommends a VPN over port forwarding, since it exposes less to the internet.

Model-specific instructions

Ubiquiti UniFi Dream Machine Special Edition

The UniFi Dream Machine SE can run several kinds of VPN, WireGuard, OpenVPN, L2TP and Teleport among them, and when one will not connect or does not reach your network, the cause is usually the address, the port or the client's setup, and the UniFi Network application shows where. Open Settings, VPN, and look at the VPN server you set up. Make sure it is enabled, and note its port and protocol.

A VPN server on the gateway can only be reached from outside if the gateway has a public address on its WAN; check the WAN address in the app, and if it is private, a provider is placing the gateway behind carrier-grade NAT, and a direct VPN will not work; Teleport, which relays through Ubiquiti, may still do so. If the gateway sits behind a modem that routes, forward the port from the modem or put it in bridge mode.

The second common issue is the changing address. Use a dynamic DNS service, set under Settings, Internet, Dynamic DNS, and put the name in the client rather than the number. Check the firewall: a rule that blocks WAN to LAN or that blocks the VPN network can stop access, and the VPN has its own zone with its own rules, so make sure traffic from the VPN to the networks you want is allowed.

For WireGuard, check the keys, the allowed addresses and the endpoint on the client; a wrong key or a client time that is wrong produces no handshake.

If the VPN connects but you cannot reach devices, check the subnet of the VPN against your home network, since overlapping subnets stop routing, and the DNS the VPN gives the client. If it connects but is slow, the gateway's VPN throughput is limited, and heavy IDS adds to it. A client on a network that blocks the VPN port, such as a hotel, may need a different port or protocol; OpenVPN on TCP 443 is more likely to pass.

Update the firmware, restart and test from mobile data. Remove old VPN clients from the list to avoid conflicts. Use strong keys and keep your gateway updated since a VPN is a door.

If a VPN stops after an update, re-create the client configuration. Ubiquiti's help pages and community can assist with logs.

Only listed models
FieldValue
Model
Ubiquiti UniFi Dream Machine Special Edition
UDM-SE
ConditionVPN client or server will not connect
  • The VPN type and port
  • The WAN address
  • The client's network
  • The firewall rules

Compare possible causes

A private WAN address or a modem in front
What separates it.

Nothing connects from outside

How to confirm.

Ask for a public address, bridge the modem or use Teleport

A changing address
What separates it.

It worked and then stopped

How to confirm.

Use dynamic DNS

A firewall rule or wrong zone
What separates it.

Connects but no access

How to confirm.

Allow VPN traffic to the networks needed

Wrong keys or client time
What separates it.

No handshake

How to confirm.

Re-create the client configuration

Overlapping subnets
What separates it.

Connected but no routing

How to confirm.

Change one of the subnets

  1. Check the VPN server.

    Enabled, port and protocol.

  2. Check the WAN address.

    It must be public.

  3. Set up dynamic DNS.

    And use the name.

  4. Check firewall rules.

    For the VPN zone.

  5. Check the subnets.

    For overlap.

  6. Test from mobile data.

    From outside.

Public address

Needed for a direct VPN.

Subnets

Overlap breaks routing.

Which VPNs does the UDM SE support?

WireGuard, OpenVPN, L2TP and Teleport among others.

Why can't I connect?

A private WAN address or a blocked port.

Why can I connect but not reach devices?

A firewall rule or overlapping subnets.

Is Teleport an option?

Yes, it relays through Ubiquiti.

  • If the VPN stops after an update, re-create the configuration
  • Ask Ubiquiti or the community with logs
  • Keep the gateway updated

Ubiquiti UniFi Cloud Gateway Ultra

A VPN on a UniFi Cloud Gateway Ultra can mean two things: a VPN server that lets you reach your home network from outside, or a VPN client that sends some or all of your traffic out through a provider, and both are set up in the UniFi Network application under VPN. For a remote-access server, UniFi offers WireGuard, OpenVPN and L2TP, and Teleport, Ubiquiti's one-click option, as the product's feature list states. A server that does not connect has a short set of causes.

The first is the WAN address: the Ultra must have a public address, since a provider using carrier-grade NAT or a router in front blocks inbound connections, and the application shows the WAN IP. If it is a private address, the VPN cannot receive connections until you fix the double NAT, as the double-NAT page explains. The second cause is the address the clients use: if your public address changes, use a dynamic DNS name, and make sure the clients point to it.

Third, check that the VPN's port is open on any device in front and that the Ultra's firewall allows the VPN traffic, which the application creates automatically.

For speed, a VPN is limited by the Ultra's processor. Encrypted traffic is slower than plain routing, and with IDS/IPS also on, throughput falls further, as owners on the Ubiquiti community report, so test the VPN with threat management off to see the difference. WireGuard is generally faster than OpenVPN on this class of hardware.

For a client VPN to a provider, check that the policy-based routing sends the right devices through the tunnel and that DNS does not leak. If a site-to-site tunnel drops, match the settings on both ends, such as the encryption, the subnets and the lifetimes, and make sure the subnets do not overlap, for example both using 192.168.1.0. Update the gateway and application.

Check the logs in the application for errors. If clients connect but cannot reach devices, check the allowed subnets and the firewall rules between the VPN network and your LAN. Use strong keys and remove unused clients.

Remember to review the list of VPN clients every few months and delete the ones you no longer use. Each client holds a key that can reach your network, so a phone you sold or a laptop you replaced should lose its access. If you share a client with family, create separate ones so that you can revoke each separately.

Check the gateway's logs for connection attempts from unfamiliar addresses and keep the application updated.

Only listed models
FieldValue
Model
Ubiquiti UniFi Cloud Gateway Ultra
UCG-Ultra
  • The VPN type
  • The subnets at each end
  • Errors in the logs

Compare possible causes

A private WAN address
What separates it.

Remote VPN clients cannot connect

How to confirm.

Fix double NAT or CGNAT

A changing public address
What separates it.

The VPN works then stops

How to confirm.

Use dynamic DNS

IDS/IPS and encryption together
What separates it.

The VPN is slow

How to confirm.

Test with threat management off

Overlapping subnets
What separates it.

A site-to-site tunnel fails or cannot route

How to confirm.

Use different subnets at each site

Firewall rules
What separates it.

Clients connect but cannot reach devices

How to confirm.

Check the rules between VPN and LAN

  1. Check the WAN address.

    Public or private.

  2. Use dynamic DNS.

    If it changes.

  3. Pick WireGuard.

    For speed.

  4. Check the firewall.

    Rules between networks.

  5. Read the logs.

    For errors.

Subnets

They must not overlap between sites.

Processor

Encryption is limited by the gateway's CPU.

Why will my UniFi VPN not connect?

A private WAN address or a wrong address.

Which VPN is fastest?

WireGuard.

Why is it slow?

Encryption plus IDS/IPS.

What is Teleport?

Ubiquiti's one-click remote access.

  • If the VPN fails with a public address and correct settings, contact Ubiquiti
  • If the address is CGNAT, contact the provider
  • Update the gateway

References for the model instructions