OpenWrt
keen-pbr is installed on OpenWrt from the keen-pbr package repository. You run the commands over SSH.
Find out which package manager your OpenWrt uses
A package manager is the program that installs and updates other programs. Which one you have depends on the version:
- OpenWrt 25.x and newer:
apk - OpenWrt 24.x and older:
opkg
Install keen-pbr
- Connect to the router over SSH.
- Open the keen-pbr repository page, select the OS OpenWrt on the left, then your version and architecture. Run the commands it shows, in order.
- Install the package:
# OpenWrt 25.x and newer
apk update
apk add keen-pbr
# version without the web UI and API:
# apk add keen-pbr-headless# OpenWrt 24.x and older
opkg update
opkg install keen-pbr
# version without the web UI and API:
# opkg install keen-pbr-headlessThe configuration is in /etc/keen-pbr/config.json. The service starts by itself every time the router boots.
keen-pbr-headless takes less space: about 1.2 MB instead of 2.8 MB. It has no web UI and no API, so you configure it through the config file. If in doubt, install the regular keen-pbr.cannot bind netfilter queue/log ... Invalid argument, install them manually: kmod-nfnetlink-queue, kmod-nfnetlink-log and kmod-nft-queue.Check that the service is running
service keen-pbr statusIf everything is fine, the command prints running.
Open the web UI
Open http://<router-ip>:12121 in your browser, for example http://192.168.1.1:12121. The headless version has no web UI.
Set up your first rules
Go to the Quick Start page and open the Web UI tab. If you installed keen-pbr-headless, open the JSON tab.
Service commands
service keen-pbr start
service keen-pbr restart
service keen-pbr status
service keen-pbr enableenable turns on autostart when the router boots.
Separate DNS servers for lists (dnsmasq)
On OpenWrt, dnsmasq already works as the router’s DNS server. keen-pbr does not need it for routing. To decide whether to let keen-pbr manage it, see Do I need dnsmasq?.
Turn it on
In the Web UI, open General > Settings > Local DNS server management and turn on Manage dnsmasq configuration.
While management is on and Main DNS servers are set, keen-pbr takes the servers without a domain out of the list in /etc/config/dhcp (LuCI DNS forwardings). Per-domain servers such as /lan/192.168.1.1 stay. The removed servers return when you turn management off or clear those servers.
Return to how it was
Turn off Manage dnsmasq configuration and apply the config. keen-pbr restarts dnsmasq and returns the removed servers.