MikroTik controller with AP connected via VLAN interface

In this topic, we are going to show an example of VLAN configuration to use a hotspot server with Powerlynx. For this example, we have used a MikroTik hap ac lite as the controller and a Unifi AP AC Lite as the access point. You can use other APs from different vendors as well.

It is crucial to know that the general configuration must be done on the MikroTik device, which has a Wireguard connection (you can use a Public IP if you have one) with Powerlynx, configured as a Radius-client with a hotspot server. You need to configure the MikroTik as we have shown in our documentation: MikroTIk Advanced setup. However, there is a small difference: you need to assign a VLAN interface on the hotspot server. On the AP device, we need to adopt it and configure only the Wi-Fi network, not enabling the guest portal on it.

Note: Do not use the Simple setup “Full setup” if you want to integrate VLAN interfaces. Instead, use only “Simple setup: Setup VPN”, which generates a script to establish a WireGuard connection on your MikroTik hotspot controller.

After that, you should proceed with the steps shown below.

Simple setup: Setup VPN:

First of all, we need to connect our MikroTik to Powerlynx and configure the Radius-client (in this example, we use a Wireguard connection).

After that, we can create a bridge interface, which includes two Ethernet interfaces (one for the AP, another for the Unifi controller). In our example, ether3 is used for the laptop controller for the Unifi device, and ether4 is used to connect the Unifi AP AC Lite.

Now we are ready to create a VLAN interface on the bridge port: go to Bridge > VLANs > click “+”. You have to choose your bridge port.

  • Bridge - choose your bridge interface created for hotspot server;

  • VLAN IDs - set VLAN id you want to use;

  • Tagged - choose your bridge interface and interfaces which are connected to another routers or switches, that work with IEEE 802.11Q standard;

  • Untagged - choose interfaces that are connected to end-devices (laptops, some APs and etc.).

Then go to Interface>VLAN>click "+".

  • Name - set the name for VLAN interface;
  • VLAN ID - set the same VLAN ID;
  • Interface - choose your bridge interface.

After that, we can create our hotspot server on the VLAN interface. I recommend using the "Hotspot Setup" tool. The configuration of the hotspot server is the same as we have shown in our documentation.

Now we need to change the value of PVID for our slave ports in the bridge interface. Go to Bridge > Ports > choose port > VLAN and set the same VLAN ID.

Now it is crucial to enable VLAN-Filtering for our bridge interface. There is no need to change the PVID for that interface.

In our case, we have an unadopted Unifi device and a controller that is hosted locally on our laptop. To adopt the Unifi AP, these devices must be in the same hotspot network. To adopt it properly and have the ability to ping, I have added these devices to the bypass list. To do this, you can use the MAC Address or IP Address (I recommend to use MAC Address).

Screenshot from 2024-06-11 16-49-29

Make sure your AP gets an IP address from the correct IP range and is located in the correct VLAN ID.

Then adopt your AP device and create a Wi-Fi network on it.

Don’t forget to customize login.html and add some hosts to Walled Garden list on your MikroTik device.

How would this be implemented in a cloud hosted controller?

1 Like

Hello Lehana,

It depends on where your MikroTik CHR is located. If your MikroTik CHR is hosted on a VPS (e.g., AWS, DigitalOcean, etc.), you can connect your Ubiquiti AP (or other devices) via a VPN tunnel or EoIP. You can use one of the following network topologies:

Powerlynx → Hotspot Controller (MikroTik CHR) → AP Device(s)
Powerlynx → Hotspot Controller (MikroTik CHR) → Proxy Device → AP Device(s)

Proxy Device: This is a device used to establish a VPN tunnel with the hotspot controller and can serve as a gateway for the AP devices.

We can show you an example from our side later.

My scenario is, I assume fairly similar to Lehana’s. I have my Mikrotik router on site and the AP’s connected as a mesh from say ether2. My controlller is on DO under ubuntu server lts24. Can I install Mikrotik CHR on the same server and create the connection?

Hello Craig,

Unfortunately, we cannot guarantee that such a setup will be fully accessible or feasible.

Theoretically, you can install MikroTik CHR on the same Ubuntu server as long as you use virtualization (e.g., KVM or VirtualBox) or containerization (e.g., Proxmox, LXD, or Docker with nested virtualization support).

Here are some potentially useful links:

However, we haven’t tested this kind of setup ourselves, so we cannot recommend it or guarantee that it will work 100%.

Alternative Approach

You can create a separate MikroTik CHR VPS on a cloud provider (e.g., AWS, Google Cloud, Hetzner, etc.).
More information is available here:
https://help.mikrotik.com/docs/spaces/ROS/pages/18350234/Cloud+Hosted+Router+CHR#CloudHostedRouter%2CCHR-HowtoInstallavirtualRouterOSsystemwithCHRimages

For example, you can create a free-tier instance on AWS to test MikroTik CHR with a free license.
Here’s a video guide on how to do that: