Debian
keen-pbr is installed on Debian from the keen-pbr APT repository. Run the commands over SSH or in the server terminal as root (or with sudo).
Add the repository
Open the keen-pbr repository page, select the OS Debian on the left, then your release and architecture. Run the commands it shows, in order: they add the signing key and the apt package source.
Install the package
apt update
apt install keen-pbr
# version without the web UI and API:
# apt update
# apt install keen-pbr-headlessThe configuration is in /etc/keen-pbr/config.json. The service starts right away and starts at every system boot.
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.Check that the service is running
systemctl status keen-pbrIf everything is fine, the output contains active (running).
Open the web UI
Open http://<server-ip>:12121 in your browser. 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
systemctl start keen-pbr
systemctl status keen-pbr
systemctl restart keen-pbrSeparate DNS servers for lists (dnsmasq)
dnsmasq is not needed for routing. It is a DNS server installed on the system next to keen-pbr. Install it if you want to send the domains of some lists to separate DNS servers, or set your own main DNS servers. See Do I need dnsmasq?.
Install dnsmasq
apt install dnsmasqTo apply the recommended dnsmasq settings, run:
/usr/lib/keen-pbr/dnsmasq-hook.sh install-recommended-configIt replaces /etc/dnsmasq.conf and saves the previous file as /etc/dnsmasq.conf.backup-keenpbr. dnsmasq then answers only your local networks and takes its servers from keen-pbr.
Then, in the Web UI, open General > Settings > Local DNS server management and turn on Manage dnsmasq configuration. Point the system resolver (or your DHCP server) at dnsmasq if it is not already used.
Return to how it was
- Turn off Manage dnsmasq configuration and apply the config. dnsmasq restarts and uses the servers from
/etc/keen-pbr/dnsmasq-fallback.conf. If dnsmasq has servers of its own, these are added to them; clear the file to avoid that. - Restore the system resolver you used before dnsmasq.
- If you ran
install-recommended-config, put the old settings back:bashcp /etc/dnsmasq.conf.backup-keenpbr /etc/dnsmasq.conf systemctl restart dnsmasq - Or remove the package:
bash
apt remove dnsmasq