User Tools

Site Tools


hstarwiki:cust:gen:unifi

Unifi Basics

Unifi is a managed wifi system. It allows for multiple Ubiquiti Unifi Access Points to be controlled and managed by a central control software system , or Software defined networking.

Links:

The unifi system contains the following components:

  • Internet connection via WAN
  • Router with LAN
  • Controller (software or cloud key)
  • Back haul LAN network for Unifi AP's
  • Unifi Access Points
  • User Portal control (optional but often used)

Unifi Controller and setup

The controller software manages the APs and various Client settings. The software is on a device on the network. This device must exist on the Local Area network of the Unifi AP's. This controller can come in a few different forms:

  • Stand Alone software on a local machine with Unifi Controller Software NOT linked to Cloud Access
  • Stand Alone software on a local machine with Unifi Controller Software linked to Cloud Access
  • Cloud Key controller or Unifi Secure Gateway

IMPORTANT This device must be on at all times and exist on the network at all times. If it does not, the APs will will allow access with or without a password, and will do traffic shaping, but the portal will not exist. The Unifi AP's do not work like standard ubnt devices and can not be logged into via a web portal to control, though they can be accessed via ssh.

Installation of network and hardware

  • Setup Router and LAN.
  • Router can be simple with no wifi.
  • The router can be independent or a Unifi router managed by the controller.
  • There can be 2 main kind of subnet configurations:
  • * A simple subnet that is the encompasses the main router, controller and Unifi APs
  • * With Unifi routers and othe rhardware you can have a different subnet for clients who connect to a Unifi AP
  • The LAN that the Unifis are on can be any combination of Routers, switches, wireless links.
  • Important The Ubuiquti Unifi APs are the only devices that can act as APs and be managed by the controller. You can not for instance use a loco to connect to an Unifi and keep it in bridge mode. (this is not fully tested, but apparently will not work.)
  • Controller in 2 options:
  • * Option 1: Download controller software and install on machine.
  • * Option 2: Go to IP address of Cloud key (may need to use nmap to discover IP) and register with a ubnt account

Linux Installation

Manually download and install

These are simple instructions udpated in 2019 to download the unifi controller software manually. You can find the link for the most current version on the website

 wget unifiCurrent.deb

You should update and upgrade the repositories and packages

sudo apt update
sudo apt upgrade

Now the package can be manually installed and will perform the needed dependencies.

sudo dpkg -i unifi_sysvinit_all.deb
sudo apt install -f

Once installed, be sure to enabled it for startup

sudo systemctl enable unifi

There may be some other steps below that were performed AFTER these three commands listed directly above. Might take some tiral and error.

Other ways of installing

Here are some other ways of installing tha are either old, not fully tested, or did not work properly.
Very good instructions are here:https://help.ubnt.com/hc/en-us/articles/220066768-UniFi-How-to-Install-Update-via-APT-on-Debian-or-Ubuntu
here is a summary of the type of commands you do:

  • Add the unify repositories by creating a file in /etc/apt/sources.list.d/100-ubnt.list

sudo nano /etc/apt/sources.list.d/100-ubnt.list

deb http://www.ubnt.com/downloads/unifi/debian testing ubiquiti
deb http://www.ubnt.com/downloads/unifi/debian oldstable ubiquiti
deb http://www.ubnt.com/downloads/unifi/debian stable ubiquiti
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 06E85760C0A52C50
sudo apt-get update
sudo apt-get install unifi

Access Local Unifi Controler Configuration

The controller acts as a daemon and web host. It can be accessed either:

  • Windows: Click on software icon to start controller software
  • The window will say “launch a browser to manage the network” Or:
  • Go to: https://[localhost or IP of controller]:8443

Cloud access

Cloud Access

The cloud access software can now be accessed with both the local controller software (as of 4.3) and Cloud key. This allows you to connect your controller, wherever it is, to the Ubiquiti server. You must have a registered account. You can use the same for forums. This account will be remotely linked to your controller. Once you have it linked, you can then remotely manage your unifi system. Multiple unifi systems can be managed from the cloud access.

Unifi AP's

Ubiquit makes a wide range of indoor and outdoor Unifi AP's and other unifi things like cameras and phones. Here are some tips about setting up.

  • The ubnt unifi APs are adopted by a cloud controller.
  • The Cloud controller configures the devices via discovery
  • APs can function without the controller after configured. But things like portals, user control, zero handshake, paywall will not exist. ONly simple things like routing, SSID and pass, like a typical router. No
  • The APS need to be on the same network to be adopted.
  • IMPORTANT! The unifi Must be on a DHCP network
  • If you want to do things like configure an IP or VLAN, you should add the Unifi to a controller and configure it there

Password

Once you adopt a new unifi, it will gain the user name and password that was set up for the contoller. This is very important when doing some of the steps below

Changing Controllers

If you want to move a unifi AP to a different controller, you need to follow these steps. This is especially important when setting up a new unifi on a network without DHCP

  • Setup a primary unifi controller on the desired network. Know what IP your controller is on.
  • install temp unifi Controler on a DHCP network
  • install unifi AP on the same DHCP network
  • You can do whatever config you want, but make it basic.
  • Log into temp unifi controller
  • Go into the AP settings and change IP address to something that will work on master controller network
  • Apply
  • Move Unifi AP to desired network (set inform will not work if not on the same network)
  • SSH into AP and run this command:
  • $set-inform http://[ip.of.master.controller]:8080/inform
  • exit
  • Access Master controller
  • The AP should automatically be provisioning or already adopting

NOTE!! Although this method did work at one time, it also failed on a second try. It may be that you will need to set the DHCP network below the main controller but where it can ping the main controller. Then You could actually try to adopt the unifi in a more traditional sense.

You can read more here: https://community.ubnt.com/t5/UniFi-Wireless/Adopting-your-Existing-APs-to-set-inform-to-L3-Controller/td-p/471517

Editing Client Splash Page

Enable Editing

If you want to edit the portal, you will need to first enable the portal and editing it. Then a folder structure will be created to access index.html and other files for editing the visual look

  • Login to your controller (cloud or local)
  • Settings > Guest Control > Guest Policies >
  • > Enable Guest Portal > Check to enable
  • > Authentication > No Authentication. Here you can also set various rules such as password or hotspot for paying, but mostly we just want “No authentication” to have a simple agree to terms and service
  • Settings > guest Control > Portal Customization > Override Default Templates > Check to Enable. This is the step that will create a directory and files to edit.

Editing index file

There is a single index.html file that holds most of the information for the different web portals. So if you want to edit the no auth page, or voucher page, you edit this. It is also important to know that there is a folder called “portal” which contains all the files needed for the web hosting. You can make a compressed version of this folder as a backup if you have multiple things you are editing.

View Splash page

To view the splash page even after accepting terms go to:

Accessing Files

To change the splash page you Need to edit the master index file or other files associated to it. You need to access files and/or folders of location of webpages:

  • Windows access to cloud key: Use win scp with the address of the cloud key. You can either be on site and use the IP of the cloudkey or controller, or setup port forwarding to access remotely.
  • Local Controller: find the directory on the local machine running the controller
  • Linux: Use scp or another type of file transfer protocol

Access the directory for the main files:

  • Linux: /usr/lib/unifi/data/sites/default/portal
  • Windows: C:\Users\<user>\Ubiquiti UniFi\data\sites\defualt\portal
  • For main index.html and styles.css

Once you have access to the folder structure

Data Locations and backup

Most of the Main data for the unifi is located in:

  • Linux: /usr/lib/unifi/data/

Backup

Backup is simple: https://help.ubnt.com/hc/en-us/articles/226218448-UniFi-How-to-Configure-Auto-Backup
Basically you have to go to the unifi setting and at the bottom is the autobackup settings, from there you can set the frequency. If you want to transfer the file to another device, you can use a cron job.

Hotspot and Vouchers

Work in progress

Untested

These are things untested by the writer of this article

  • When doing a setup and then move to main controller, will the AP retain the password of the temp controller and will this impede future changes? Would need documentation or be forced to reset.
  • Testing with Zero Handover
  • There may still be a way to ssh into a blank unifi WITHOUT a controller and change the IPs. Then you adopt the Unifi easily with your main Controller

Other

Rasberry Pi

Troubleshooting

log /usr/lib/unifi/logs/server.log /usr/lib/unifi/logs/mongod.log

resetting configuration

If you are having issues with login, like you forgot your password, you can reset the basic config by renaming the file that holds initial setup. Then restart the service. Here is how to do it on linux:

sudo mv /var/lib/unifi /var/lib/unifi.old
sudo systemctl restart unifi

Remote Reset

If you can ssh into device you can remove its adoption with some commands. THis is helpful when the device is difficult to physically reach.

ssh
set-defualt

Isolated DHCP server

In order to have a separate DHCP server that Clients get when attached from AP's you need the Ubiquiti “Unifi secure gateway”. Otherwise you have to use the DHCP of the gateway the unifi is attached to. The APs, nor the controller software will not give out DHCP on their own.

You can have the AP's connect to another AP for its uplink. THis is called “wireless uplink” in the ubiquiti nomenclature. To do this, you can follow this guide. We will have unifi A as the Master AP and unifi B as the device with the wireless uplink to unifi A

  • A and B should be adopted by the controller in the traditional unifi sense where they are both on the same subnet and connected via LAN (even if the LAN is through a wireless bridge.)
  • Remove B from the network so it is powered, but no longer on the subnet via LAN.
  • In the controller page, refresh until it is disconnected, wait for it to say “Isolated”
  • Choose B. The right pane will appear
  • choose Configure in the left pane
  • Below, drop down “Wireless Uplink”
  • A should be listed as long as its in range. Click the Chain Icon and you are done.
  • It will take a few minutes but that will work

Done! Different models might have different compatibility. You can only have 4 sub APs off of one, and sub APs can not host other sub APs.

Here is a lot of information about Wireless Uplink: https://help.ubnt.com/hc/en-us/articles/205146000-UniFi-Set-up-UAPs-in-wireless-uplink-topology
With a unifi mesh device, It is important to know that the wireless uplink uses the 5ghz channel and is not available with 2ghz. So if you use an omni 2ghz, and disable 5, you will not get wireless uplink.
Here is some information about some of the restrictions, with 2 specific points quoted.
https://community.ubnt.com/t5/UniFi-Wireless/UniFi-Mesh-vs-AirMax-Rockets-Bullets-for-open-mine/m-p/1988550/highlight/true#M237441

07-12-2017 10:43 AM
rebelwireless
UAP-AC-M units with AM-2G15-120, AM-2G16-90, AMO-2G10, or AMO-2G13 antennas may be a good choice.  These are used by many people for outdoor coverage.  These antennas are tuned to 2.4Ghz.  The 5Ghz radio will work with them but expect gain to be significantly lower than a 5Ghz antenna.

07-12-2017 01:30 PM
Dave-D
No: you should not use these 2.4GHz antennas as if
they were dual-band--they are not. If you must use
these, you should turn off 5GHz entirely. There will
be no uplink service available.    Dave
hstarwiki/cust/gen/unifi.txt · Last modified: 2019-06-02 T 22:18 by admin