1. Install controller



To install the UniFi controller, we need to install mongodb, Java JDK, unzip, wget first.

yum -y install epel-release

yum -y install mongodb-server java-1.8.0-openjdk unzip wget

Install Unifi controller and

yum install http://dl.marmotte.net/rpms/redhat/el7/x86_64/unifi-controller-5.8.24-1.el7/unifi-controller-5.8.24-1.el7.x86_64.rpm
systemctl enable unifi.service
systemctl start unifi.service

Then we need to open a couple of ports for controller to function:

sudo firewall-cmd --add-port=22/tcp --permanent
# Unifi - Device Inform & Management   
sudo firewall-cmd --add-port=8080-8081/tcp --permanent
#https management
sudo firewall-cmd --add-port=8443/tcp --permanent
#Unifi - Guest Portal Redirect (SSL)
sudo firewall-cmd --add-port=8843/tcp --permanent
# Unifi - Guest Portal Redirect
sudo firewall-cmd --add-port=8880/tcp --permanent
sudo firewall-cmd --add-port=10000-10010/tcp --permanent
#AP discovery, without which you will not see devices from the controller
sudo firewall-cmd --add-port=10001/udp --permanent
# Port 3478/udp is used by the APs to report into the controller using the "STUN" protocol, you controller and APs can work, but there will be a yellow warning mark next to the device in controller
sudo firewall-cmd --add-port=3478/udp --permanent

Give the controller a static IP address:

sudo vi /etc/sysconfig/network-scripts/ifcfg-eth0

Then open a web browser and type:



2. Create a WLAN

During the initialisation, you will be asked to create a wireless network, if you want to create multiple WLAN, and put more control on the WLAN, follow below steps:

Step1, create user group for a SSID, from where we can control the bandwidth, go to settings > User groups, create a user, then set the bandwidth limit for download/upload.

Step2, go to the settings > wireless networks. Select the User Group created in Step 1. Configure Security Authentication method and Guest Policy if required.

3. Adop device to Remote Unifi Controllers

By default unifi APs adopt to the controllers via Multicast/Broadcast packet. So if you use one controller for multiple site or deploy controller on cloud will need some extra configuration. The main issue is DHCP options 43.

See below article to configure the DHCP on routers


If you using windows DHCP server, then use below article:

Right click on the IPV4 node just below your server name, and choose Define Vendor Classes. You will be presented with this fancy screen.

Add a new vendor class by clicking the Add button. In the New Class window, enter a Display Name (I suggest Ubiquiti) and an optionally enter a description. In the ASCII portion of the lowest box type the letters ubnt. Make sure there’s nothing else, to include white space, in that box. The whole line should read 0000 75 62 6E 74 ubnt as in the screenshot. Click OK, then Close to close both windows.

Right click the IPV4 node again and choose Set Predefined Options from the context menu. In the Predefined Options and Values window, choose your new Ubiquiti class from the top dropdown, and click the Add button to create a new option.

In the Option Type window, enter UniFi Controller, or some similar name, into the Name box, choose Binary in the Data type dropdown, and enter 1 in the Code box. I chose to write “IP as HEX in the BINARY section: 0a 0a 0a 02” in the Description box to remind myself how to enter the controller’s IP address later. Click OK, then OK again to accept and close both windows.

We have now defined both the Ubiquiti vendor class and a predefined option in that class that we can use to point our devices at our UniFi Controller, no matter what subnet they’re on.

For each subnet that contains UniFi devices, we must now add our newly created option to the Scope Options. Begin by right clicking the Scope Options node under one of your Scopes, and choosing Configure Options. Click the Advanced tab and choose Ubiquiti under Vendor Class dropdown.

There’s only one option, so that’s obviously the one we want. Make sure it’s checked, and then erase the default value in the Binary section.

We now need to do a little math. The IP address of your UniFi Controller must be converted from decimal to hexadecimal. Windows 8.1 and later (at least) makes this extraordinarily easy with the built in calculator.

Open the windows calculator and go to Programmer mode. Ensure DEC mode is selected and type in the first octet of your UniFi Controller’s IP, then see the HEX value displayed. Windows displays the value as a single digit when possible, but when entering it in hexadecimal, it must be 2 digits. Prepend a 0 to any single-digit hex values you get. For example, 10 converts to A, so you would prepend a 0 and get 0A for your hexadecimal octet.

Repeat this for each octet in your IP address, writing down each hex value.

Note: If you are using the older version of calculator (before the Windows Universal Apps version), you may need to click the HEX radio button to see it converted.

Once you have all the hexadecimal octets, you need to enter them into the Binary section of the Data Entry box. Just type the numbers in the order of the octets. An IP of, for instance, would be entered as 0A 0A 0A 02. Click OK to close the Scope Options window.

Reboot your APs and watch them magically appear in your UniFi Controller