Ubiquiti Unifi UDM

Pritunl Link client on Ubiquiti Unifi UDM

The Pritunl link client will automatically manage the routing table and port forwarding on the Unifi UDM. This allows for a high availability configuration to handle a failure on the link client. For dual WAN configurations a link client can be configured to port forward each WAN and the link will remain available with one WAN offline.

Unifi Configuration

From the portal click Manage Users then click Add User. Set the Name to Pritunl API and set the Role to Limited Admin. Set the username to pritunl and generate a random password. Then select Administrator under the UniFi Network permissions. Set all the other permissions to None then click Add.

Run the commands below on the instance to install the pritunl-link package. The firewalld service must also be disabled.

Next run the first command if your Pritunl server does not have a signed HTTPS certificate. The data will be signed and encrypted with AES independently an unsigned certificate will not effect security. Then run the second command to manually set the provider to unifi. The next three commands are used to set the Unifi username, password and controller URL. The third command will clear all host URI's, this should be run to ensure previously configured URIs are removed. The fourth command will add the URI, this needs to be replaced by clicking Get URI in the Pritunl web console. This command can be run multiple times if more then one link is configured. The sudo pritunl-link verify-off line can be left out if the Pritunl server is configured with a valid SSL certificate. It is not necessary to verify the SSL certificate, the sensitive data is encrypted with AES-256 and signed with HMAC SHA-512 using the token and secret in the URI.

For dual WAN configurations the forwarding interface can be set using the command below. For the first link client use WAN and WAN2 for the second link client. If only one link client is used on a dual WAN configuration the interface must be set to BOTH. For single WAN configurations this command is not needed.

If you are using multiple sites you will need to set the site ID using the command below. The site ID can be found in the dashboard url such as default in https://10.0.0.1/network/default/dashboard. If the site ID is default this command is not needed.

The commands below can be run to check the logs and status of the link. The pritunl-link service will already be running and connected once the URI is added.

Last updated