portuno
EspañolComing soon

Connect Ubiquiti

Recent UniFi gateways have a WireGuard client. EdgeRouters do not.

Guide in preparation

Status of this guide

UniFi (UDM, UCG, UXG on Network 8.1 or later): the .conf file goes in Settings › VPN › VPN Client › Create › WireGuard. We have not yet checked on a device that it keeps the preshared key on import or that it accepts connections arriving through the tunnel, so we do not publish the steps yet.

EdgeRouter: EdgeOS does not ship WireGuard. It only works with a community package, and we have no guide for it.

The general steps

  1. Load the configuration

    If your device accepts WireGuard files, import the .conf as it is. If not, create a WireGuard interface with your private key (the PrivateKey line) and the tunnel address (the Address line).

  2. Add your node as a peer

    On that interface add a peer with your node’s public key (PublicKey), the preshared key (PresharedKey), the Endpoint from your file (your address and port 51820), the AllowedIPs from your file and a keepalive of 25 seconds.

  3. Check the route into the tunnel

    Some routers do not create routes from AllowedIPs. If yours does not, add a route to 10.77.0.0/24 through the tunnel interface.

  4. Let the tunnel traffic through

    In the device’s firewall, allow what arrives through the tunnel from 10.77.0.1 to the devices and ports you are going to map. The rule goes before any rule that blocks.

  5. Check the handshake

    In the panel, inside your site, the device shows its last handshake a few seconds ago. If it still says “Never connected” after a couple of minutes, see when there is no handshake.