VPS Hosted Unifi Controller - STUN Error

VPS Hosted Unifi Controller - STUN Error

2021, Aug 29    

Problem

Receiving STUN errors on Unifi controller running on cloud hosted server like Digital Ocean or AWS. You have already allowed the STUN port 3478/UDP and still receive a STUN error like this:

“This device is not able to connect to the internal STUN server. Please check if the device is able to reach the STUN server on port 3478.”
stun-error-vps-floating-ip-unifi-error

Solution

If you are using an elastic ip with AWS or a floating ip with Digital Ocean this may be your problem. The STUN request goes to the elastic ip/floating IP, but the server responds from it’s own ip address instead of the floating/elastic IP. This causes the STUN error in the Unifi controller.

Dont’ use a floating/elastic IPs with hosted Unifi controller.