If you are an old hand with Linux you are probably very familiar with iptables.
In the old days firewalls were done using iptables and in case you needed to do packet management on layer two you would use ebtables.
Fast forward to today and we have the much more advanced and user friendly nftables.
nftables allows you to do packet management on layer three and layer two.
OpenWrt version 22.03 migrated to use nftables instead of iptables.
We took the opportunity to take advantage of this improvement with our per device block and speed limit feature.
This means that the feature will require OpenWrt version 22.03 or higher based firmware to work correct.
One aspect which makes our implementation unique is the fact that we work on layer two and not layer three.
The reason for this is that MESHdesk and APdesk allows you to create bridged networks where the IP Address management (DHCP) can be done by another device on the network.
By working on layer two it allows us to block and apply speed limits without the requirement to know the IP Address of a device.
You will need the compulsory kmod-nft-bridge nftable module . Make sure it is included with the OpenWrt based firmware.
Every time you apply or remove a block or speed limit the affected Access Points will be instructed to fetch their latest firewall settings from the controller.
The utility script that does this is /etc/MESHdesk/utils/fetch_firewall.lua.
If MQTT (Real time) support is enabled this will happen in real time else it should happen on the next heartbeat that the Access Point sends through which is typically in less than one minute.
The meshdesk bridge table is where things are happening.
You can inspect the table using the following command nft -e -a list table bridge meshdesk.
During startup the Access Point will also, as part of the configuration data sent to it, have a firewall section included (if there is devices that needs to be blocked or speed limited).
This will then be applied as part of the setup routine.