Configure UDM/UCG to allow Wifi Sync API access

Configure UDM/UCG to allow Wifi Sync API access

If you are using a Unifi Gateway that is configured to work with a ui.com account, by default your controller is blocked to the internet. 
The below process will open up your UDM/UCG to allow the Wifi Sync platform to interact with your controller over the internet. 


Notes
Note: By exposing your controller login to the internet you should ensure that you have set a secure, complex password for all your users.

Step 1: Log in to UniFi Network

  1. Open your UniFi Controller Web UI (local or remote).

  2. Go to Settings → Internet → Port Forwarding (or Firewall & Security → Port Forwarding in some UI versions).


Step 2: Create Port Forwarding Rule

  1. Click Create New Port Forwarding.

  2. Configure the rule:

FieldValue
NameUniFi_API_Custom_Port
From Port (External)51443
To Port (Internal)443
ProtocolTCP
Forward To
192.168.1.1
 

(UDM LAN IP - This may be different if you are using a different IP range )
EnabledYes
  1. Save / Apply.


Step 3: Restrict Access by Source IP

Note: The IP address below is the authorised Wifi-Sync IP address servers.

  1. Go to Settings → Firewall & Security → WAN IN.

  2. Click Create New Rule:

FieldValue
NameAllow_API_from_WifiSync
ActionAccept
ProtocolTCP
Source13.54.236.37
Source PortAny
Destination192.168.1.1
Destination Port51443
EnabledYes
  1. Place this rule above any default drop rules to ensure it takes priority.


Step 4: Block All Other WAN Access to the Port

  1. Create a second rule below the above rule:

FieldValue
NameBlock_Other_API_Access
ActionDrop / Reject
ProtocolTCP
SourceAny
Destination192.168.1.1
Destination Port51443
EnabledYes
  1. Save / Apply.


Update WiFi Sync URL

Navigate to the WiFi Sync Dashboard Portal
Where it asks for Unifi Controller URL enter the Public IP address of your controller and the Port as configured above
You can find the Public IP address on your Gateway Dashboard, use this to update your Unifi Controller URL.