This article is written by Server Management Inc. IT systems administrator Timo Puistaja - 16.03.12.2017, Tartu, Estonia.
We are going to explain how Unifi AP/switch adoption on Layer2 and Layer3 works, but first let´s make clear what the those Layers mean.
Layer2 (L2) adoption: We adopt Unifi AP/switch to a Controller in the same subnet for example your "mask:/24" LAN.
The Layers come from OSI (Open System Interconnection) model. This is used to visualize computer networks. We will focus on the "Network Layers" and especially on Layer2 and Layer3 for Unifi adoption methods.
Unifi Controller: a webpage/software to centralize and manage all your wifi devices no matter where they are located. You can install Controller software to your own PC, but when it comes to larger networks its recommended to install it on any Windows/Linux server in your enviroment or buy a Unifi CloudKey (CK) that has Controller already installed on it. You can think of Unifi CloudKey as a little PC/server just for serving the Controller function for your AP´s. I wrote an article about setting up the crentralized CK Controller with my own certificates - it´s HERE.
As you can see Layer1 is Physical - it is the Layer where different physical devices (ethernet/wireless card and switches or routers) are connected.
First layer of usable data flows is Layer2 - this Layer can be explained as the Layer of your LAN network in our case.
Layer3 is the layer where different subnets and networks are connected together and thats why its called L3 adoption for Unifis - AP and Controller are in the different subnet.
L2 adoption is very staightforward. Lets assume you are in your home/office that has LAN subnet 192.168.0.0/24.
Your PC IP is: 192.168.0.10 and you have downloaded and istalled Unifi Controller software from unifi Download page.
Now you connect your new AP to local network and DHCP server gives out an IP to your AP - for example 192.168.0.20.
All you have to do now is to log into the Controller panel from your web browser and you can see your AP in the Devices menu and Adopt it - that it - L2 Adoption done.
I strongly recommend installing Controller software to any servers you already have - so you wont be messing around later with the reinstalls/resets with all the Unifi products OR buy CloudKey its only about ~100USD.
Here a little picture showing your how it works:
L3 adoption means that you have Controller and AP in the different subnet OR in the different county/city/building.
For L3 adoption you need access to your router/firewall and should have public static IP from your ISP.
Most of the configurations need to be done at the office where Controller is located.
Install the Controller to any server or buy CloudKey and set it up. Give it a static local ip - in my example it´s 192.168.0.10
Now we need to make our controller webpage and set-inform features accessible from all over the world.
In this example we have static public IP 220.127.116.11, so you need to log in to your router and make port forwards as follows:
In addition if you have access to the Domain registar panel you can set up A record to your public IP, for eg.:
unifi.mydomain.com POINTS TO 18.104.22.168
So later you dont need to type in the IP - you can just use the name instead.
By default, the UniFi Controller will operate on the following ports:
Note: You might neet to open up ports 8080 and 8443 in your firewall to make incoming request to access next (forward) rules.
When you have done that your Controller is accessible from anywhere in the world - also the webpage.
You are ready to do some L3 adoption, these are the steps to inform your AP´s where the Controller is:
You need LAN access to your AP and SSH (Putty is a Windows tool to do that) into the AP - default username and password are ubnt / ubnt.
Type in the following commands in the commandline of AP:
Thats it - your L3 adoption is done, you can add as many devices as you like no matter where they are located.
Here is a simple picture to overview everything explained above: