Per-device network speed and bandwidth monitor for OpenWrt
Azizi_NetSpeed adds a real-time network monitor to the OpenWrt LuCI interface. It shows per-device upload/download speeds and total data usage using nftables kernel counters, running entirely on the router with minimal overhead.
I built this because I needed something lightweight enough to run on an Archer C50 v6 (8MB flash, single-core MIPS, 64MB RAM) without slowing anything down. Most monitoring tools are way too heavy for that kind of hardware.
-
Live per-device speeds — see who's downloading what, right now
-
Total usage tracking — bytes and packet counts per IP, reset daily
-
Online/offline status — based on actual nftables timeout expiry, not guesswork
-
Yesterday's usage — collapsible panel showing archived data from the previous day
-
Mobile friendly — responsive layout, works fine on phone browsers
-
Zero background processes — no daemons, no polling scripts, everything runs in-kernel
-
Bandwidth Limiting for IPs & Ranges
Limit single devices or entire IP ranges (e.g.192.168.1.100-192.168.1.150or192.168.1.0/24). -
Two Limit Modes
- Strict (DDC): Hard cap — device cannot exceed the set speed.
- Shared: Minimum guaranteed speed + ability to borrow extra bandwidth when the network is idle.
-
Priority System
Set devices or ranges as High, Normal, or Low priority. High priority traffic gets served first during congestion. -
Low Ping / Gaming Optimization
Enable Cake qdisc withdiffserv4+ack-filterfor significantly reduced latency while downloading/uploading. -
Rule Timeout Give a QoS rule a lifetime in minutes and it expires on its own. The deadline is held by nftables as an element timeout, so the kernel drops the rule when the time is up — nothing polls, and the limit stops the moment it lapses. Editing another rule does not restart a running timer, and a lapsed rule is not resurrected. The countdown lives in kernel memory, so a reboot restarts it.
-
Advanced Scheduling
Set custom time windows (Start Time & End Time) and choose specific days of the week. Rules automatically activate/deactivate. -
Global Settings Panel
Configure Max ISP Download/Upload speeds, LAN Interface, and WAN Interface directly from the web UI — no more editing scripts. -
Dedicated QoS Rules Manager
New table showing all active limits, schedules, and priorities with easy Edit/Delete buttons. -
Reboot Persistence
All settings and rules now survive router reboots automatically. -
Tiny footprint — the whole package is under 8KB installed
The package integrates with fw4 by adding nftables sets to track per-IP traffic using kernel counters. The LuCI interface reads these counters periodically and calculates real-time speeds without background processes.
A daily cron job saves usage data and resets counters for the next cycle.
Click the "Yesterday's Total Usage" bar to expand the full breakdown. Data is saved automatically at 11:59 PM and counters reset for the new day.
┌─────────────┐ nftables sets ┌──────────────┐
│ Devices │ ───── forward ──────▶ │ up_per_ip │
│ on br-lan │ │ down_per_ip │
└─────────────┘ └──────┬───────┘
│
nft -j list set (every 3s)
│
┌──────▼───────┐
│ LuCI JS │
│ Dashboard │
└──────────────┘
- OpenWrt 22.03 or later (fw4/nftables-based)
luci-base(comes with any LuCI install)firewall4andnftables-json(standard on modern OpenWrt)
If your router runs OpenWrt with LuCI, you almost certainly have everything you need.
Two package formats are published for every release:
| File | For |
|---|---|
luci-app-azizi-netspeed-3.0-r1.apk |
OpenWrt 25.x / SNAPSHOT (apk) |
luci-app-azizi-netspeed_3.0_all.ipk |
OpenWrt 22.03 – 24.10 (opkg) |
Not sure which one you need? Run apk --version on your router — if it
answers, you want the .apk; if the command is missing, you want the .ipk.
Grab the file from the Releases
page (or from releases/ in this repo).
# Upload the file to your router first (scp, sftp, ...)
cd /tmp
apk add --allow-untrusted ./luci-app-azizi-netspeed-3.0-r1.apk--allow-untrusted is required because the package is not signed with an
OpenWrt repository key.
Uninstall:
apk del luci-app-azizi-netspeed# Upload the file to your router first (scp, sftp, ...)
cd /tmp
opkg install luci-app-azizi-netspeed_*_all.ipkUninstall:
opkg remove luci-app-azizi-netspeed- Download the matching package for your OpenWrt version
- Open your router's admin panel -> System -> Software
- Click Upload Package, select the file, and install
- Refresh the page — "Network Speed" will appear in Status
# apk (OpenWrt 25.x / SNAPSHOT) -> releases/luci-app-azizi-netspeed-3.0-r1.apk
./luci-app-azizi-netspeed/build-apk.sh
# ipk (OpenWrt 22.03 - 24.10)
./luci-app-azizi-netspeed/build.shbuild-apk.sh needs apk-tools 3 (it downloads the static Alpine build into
luci-app-azizi-netspeed/.build/ if apk is not on your PATH) and a kernel
with unprivileged user namespaces, which it uses to record root:root
ownership without running as root.
The default reset runs at 11:59 PM. To change it:
- Go to System → Scheduled Tasks in LuCI
- Find the line containing
azizi_netspeed_save - Edit the cron schedule to your preference
# Default: run at 11:59 PM every day
59 23 * * * /root/azizi_netspeed_save
# Example: run at 6:00 AM instead
0 6 * * * /root/azizi_netspeed_save
Does this slow down my router?
No. The nftables counters run inside the kernel's packet processing pipeline — they add virtually zero overhead. The JavaScript frontend only runs when you have the page open in your browser.
Will I lose today's data if I reboot the router?
Yes. The live counters are stored in kernel memory (nftables sets) and are cleared on reboot. Yesterday's archived data is saved to /root/ which survive reboots
Does this work with VLANs or multiple LANs?
The LAN and WAN devices are detected at install time. setup_devices.sh resolves
them with OpenWrt's own helpers:
. /lib/functions/network.sh
network_get_device LAN_DEV lan
network_get_device WAN_DEV wanand generates /etc/nftables.d/azizi_monitor.nft from the template in
/usr/share/azizi_netspeed/. Nothing is hardcoded, so a VLAN LAN such as
br-lan.1 is picked up on its own. If no lan interface is configured it falls
back to br-lan and says so via logread.
The same values seed LAN Interface and WAN Interface under Global QoS Settings, so bandwidth limiting works without touching the interface fields.
To count a guest or IoT VLAN as well, list it under Monitored Networks in Global Settings, comma separated:
lan, guest
Entries can be OpenWrt network names (lan, guest) or device names
(br-lan.100); anything that does not resolve as a network is used verbatim as
a device. Duplicates are dropped, and the WAN device is refused — including it
would count every forwarded packet twice and fill the per-IP counters with
remote internet addresses. Saving regenerates the rules and reloads the
firewall, so the change applies immediately.
The rules then match a set of devices:
iifname { "br-lan.1", "br-lan.100" } ct state established update @up_per_ip ...
Peers are limited by their tunnel address, e.g. 10.99.0.2, like any other
device. Matching is done on ip saddr/ip daddr in the forward hook, so the
address is all that matters.
Shaping, though, happens on the device a packet leaves by. Upload works out of the box, because peer traffic to the internet leaves via the WAN. For the download direction the tunnel has to be listed under LAN Interface, which accepts a comma separated list:
br-lan, wg0
Without that the class sits on br-lan, which traffic to a peer never
traverses, and the download limit does nothing. Removing a device from the list
tears its shaping down again.
Note that shaping on wg0 applies to the plaintext inside the tunnel; the
encrypted packets on the wire run a little higher because of the encapsulation
overhead.
One caveat: traffic routed between two monitored networks is counted twice, once as upload leaving the source network and once as download entering the other. That does not arise when the guest network is isolated, which is the usual setup.
If you change your network configuration afterwards, re-run it:
/root/azizi_netspeed/setup_devices.sh && /etc/init.d/firewall restartIt is safe to re-run: it never overwrites interface values you set yourself in the web UI, and it leaves existing per-device rules alone.
Found a bug? Have an idea? Open an issue or submit a pull request. I'm happy to review contributions of any size.
If this tool is useful to you, the best way to support it is to ⭐ star the repo and share it with other OpenWrt users. That's it — no donations, no subscriptions, just word of mouth.
Apache License 2.0 — see LICENSE for details.
Built by Mohammad Azizi for routers that deserve better monitoring tools.



