Keenetic
Requirements
- Keenetic router with OPKG support
- Entware installed (required)
Install Entware
Newer models (with built-in storage)
- Open the router web interface
- Go to System settings
- Enable the OPKG package manager component
Older models (USB drive required)
- Plug a USB drive into the router
- Install Entware through the package manager
More details: help.keenetic.com
Enable Netfilter components
Keenetic NDMS does not ship all the netfilter kernel modules b4 needs out of the box. Before installing b4, enable the required components:
- In the router web interface, go to System settings → Component options
- Enable Netfilter — the base netfilter component
- Once Netfilter is enabled, a new option appears: enable Xtables-addons for Netfilter (provides
xt_connbytesand other extensions b4 relies on) - Apply the changes and wait for the router to reboot or reload components
Then, over SSH, install the iptables userspace:
opkg install iptables
Install b4
Connect over SSH and run:
curl -fsSL https://raw.githubusercontent.com/DanielLavrushin/b4/main/install.sh | sh
Service control
/opt/etc/init.d/S99b4 start
/opt/etc/init.d/S99b4 stop
/opt/etc/init.d/S99b4 restart
Paths
| What | Where |
|---|---|
| Binary | /opt/sbin/b4 |
| Configuration | /opt/etc/b4/b4.json |
| Service | /opt/etc/init.d/S99b4 |
Architecture
- Older models (MT7621) -
mipsle_softfloat - Newer models (aarch64) -
arm64
The installer detects the architecture automatically.
Without Entware, b4 is placed in /tmp, which is cleared on every reboot. For persistent operation, Entware is required.
Troubleshooting
After starting the service, check the log:
cat /var/log/b4/errors.log
If you see xt_connbytes kernel module is not available, the Netfilter components weren't enabled correctly — return to Enable Netfilter components above and make sure both Netfilter and Xtables-addons for Netfilter are active.
If the log is empty (or has no errors), the b4 web interface should be reachable on the router's LAN IP.