
Open your UniFi Controller Web UI (local or remote).
Go to Settings → Internet → Port Forwarding (or Firewall & Security → Port Forwarding in some UI versions).
Click Create New Port Forwarding.
Configure the rule:
| Field | Value |
|---|---|
| Name | UniFi_API_Custom_Port |
| From Port (External) | 51443 |
| To Port (Internal) | 443 |
| Protocol | TCP |
| Forward To | 192.168.1.1(UDM LAN IP - This may be different if you are using a different IP range ) |
| Enabled | Yes |
Save / Apply.
Go to Settings → Firewall & Security → WAN IN.
Click Create New Rule:
| Field | Value |
|---|---|
| Name | Allow_API_from_WifiSync |
| Action | Accept |
| Protocol | TCP |
| Source | 13.54.236.37 |
| Source Port | Any |
| Destination | 192.168.1.1 |
| Destination Port | 51443 |
| Enabled | Yes |
Place this rule above any default drop rules to ensure it takes priority.
Create a second rule below the above rule:
| Field | Value |
|---|---|
| Name | Block_Other_API_Access |
| Action | Drop / Reject |
| Protocol | TCP |
| Source | Any |
| Destination | 192.168.1.1 |
| Destination Port | 51443 |
| Enabled | Yes |
Save / Apply.