
OpenWrt Traffic Monitoring: Match Tools to Tasks
Use luci-app-nlbwmon for an OpenWrt traffic monitor that tells you which device used the bandwidth. It gives you per-host accounting through nlbwmon, while vnStat keeps lightweight history for whole interfaces. Add conntrack and kernel interface counters when you need live diagnosis. wrtbwmon suits older reporting setups, and luci-app-trafficctl handles policy actions rather than complete traffic collection.
Last updated: 2026-11-05
Which OpenWrt traffic monitor should you use?
Pick the tool after you define the failure. Most traffic-monitoring confusion comes from asking one package to answer four different questions.
| Question | Tool to use | What it tells you |
|---|---|---|
| Which device used the bandwidth? | nlbwmon and luci-app-nlbwmon | Per-host traffic by address, protocol, and period |
| What connections are active now? | conntrack and LuCI conntrack | Current flow state and counters |
| How much crossed an interface? | vnStat and luci-app-vnstat | Interface totals over time |
| Which interface or process is failing? | ip counters, ss, logs, and targeted tracing | Live packet and socket state |
| Should a device be limited or blocked? | luci-app-trafficctl | Policy and control actions |
nlbwmon is the first package I install when the question starts with “which device?” It collects traffic accounting from conntrack and stores the results in a database. The nlbw client can query the daemon without going through LuCI.
vnStat answers a different question. It records traffic totals for an interface, which makes it useful for daily, monthly, and cumulative history. It cannot reliably identify the laptop that caused the total.
That split matters. A dashboard with one large number is easy to read and hard to diagnose.
nlbwmon gives you per-host accounting
nlbwmon is simple conntrack netlink based traffic accounting. On a Linux router, it monitors bandwidth used by network hosts by reading flow accounting data from the kernel’s connection-tracking system.
Here is what happens:
- A LAN device opens a connection.
- The firewall tracks that flow.
- Conntrack maintains packet and byte counters.
nlbwmonreads those counters.- The daemon assigns traffic to a local host and stores it in its database.
That model is cheap enough for a router and useful enough for normal household or small-office diagnosis. You get host-level records without running a packet capture all day.
The limits are just as important. Traffic generated by the router itself may not appear under a LAN client. A subnet that is missing from the configuration may be ignored or classified badly. Hardware flow offloading can also move packets away from the software path where accounting happens.
So I use nlbwmon to answer who used the traffic. I use interface counters to check whether the total traffic existed at all.
The database is organized into accounting periods. By default, nlbwmon tracks bandwidth over one-month intervals starting on the first of the month. It keeps up to ten interval databases by default, then deletes the oldest one. That is sensible for a router with limited storage, but it isn’t an archive.
If you need records beyond that retention, check the configured database directory and move the data to storage that survives firmware changes and reboots. A history database in volatile storage is a temporary opinion.
For the official description of connection tracking, see how Linux tracks network flows through the netfilter system.
Install and verify nlbwmon in LuCI
Install the package that matches the package manager on your router. Do not copy an install command from a forum post until you know which package manager the firmware uses.
Run this first:
. /etc/openwrt_release
printf 'Release: %s\n' "$DISTRIB_RELEASE"
command -v apk
command -v opkg
The release line identifies the installed firmware. The two command -v checks show which package manager is available.
OpenWrt changed the package manager in snapshot builds of the main development branch from opkg to apk starting in November 2024. Use the manager that exists on the router, and keep every configured feed on the same firmware branch.
For an apk system:
apk update
apk add luci-app-nlbwmon
For an opkg system:
opkg update
opkg install luci-app-nlbwmon
The update command refreshes package indexes. The install command adds the LuCI page and the daemon package it needs.
Then start the service and read the result:
/etc/init.d/nlbwmon enable
/etc/init.d/nlbwmon restart
/etc/init.d/nlbwmon status
logread -e nlbwmon
status tells you whether the daemon stayed alive. logread shows configuration, database, permission, and interface errors. An empty LuCI table proves nothing. The daemon may be stopped, watching the wrong interface, or unable to write its database.
Install and check the daemon before you spend time adjusting the dashboard.
Check the active configuration
Read the Unified Configuration Interface settings:
uci show nlbwmon
cat /etc/config/nlbwmon
Check these areas:
- Local networks that should be attributed to hosts
- Interfaces or network zones that should be monitored
- Database directory
- Accounting and commit settings
- Any excluded networks or address ranges
The exact option names can vary between package builds. Read the file on the router instead of pasting a complete configuration from another release.
Find the database directory and inspect its filesystem:
dbdir="$(uci -q get nlbwmon.@nlbwmon[0].database_directory)"
printf 'Database directory: %s\n' "$dbdir"
df -h "$dbdir"
That output tells you whether the database has room and whether it sits on persistent storage. A path under /var may live in RAM on OpenWrt. The familiar path is still allowed to behave strangely.
After changing UCI settings, restart the daemon and check the log again:
/etc/init.d/nlbwmon restart
logread -e nlbwmon
Then open the LuCI page and wait for traffic to cross the monitored path. If the page stays empty, go back to the service status and logs. Reinstalling the package is not diagnosis.
Use nlbwmon to monitor traffic per IP
Open the nlbwmon page in LuCI and select the accounting period you want to inspect. Rows normally show local hosts by IP address, with a MAC address where the router can determine one.
Use stable DHCP assignments for devices you care about. A camera that changes address will produce harder-to-read records. Static leases improve the table, but they don’t solve every identity problem.
Phones and laptops may use randomized MAC addresses. IPv6 privacy addresses can also create multiple addresses for one physical device. One person can therefore appear as several rows even when the router is working correctly.
The command-line client helps when the LuCI table looks suspicious:
nlbw -c show
nlbw -c csv
The formatted output is useful for a quick check. The comma-separated output is easier to sort or process with a script.
Export the raw rows when you need to compare the frontend with the stored data:
nlbw -c csv > /tmp/nlbwmon.csv
head /tmp/nlbwmon.csv
Check the accounting period before comparing totals. A new period can make current usage look small while the previous period still contains the older records. That is rollover, not lost traffic.
Also check direction labels. A LAN client calls traffic received from the internet a download. The WAN interface calls those same packets received traffic. Both descriptions can be correct because they use different points of view.
vnStat keeps interface history
Install vnStat when you need long-term totals for an interface. Add luci-app-vnstat if you want those records in LuCI.
vnStat is the strongest lightweight bandwidth monitor OpenWrt option for daily, monthly, and cumulative interface statistics. It does not need a packet capture for ordinary totals, and it avoids the per-host database that makes nlbwmon useful.
The package belongs on the interface whose totals you care about. For an internet-usage view, that is usually the WAN device. For internal traffic, you may need a LAN bridge, VLAN device, or another interface.
Find the interfaces before configuring anything:
ip -br link
ip -br addr
The short output shows interface names, state, and addresses. Pick the device that actually carries the traffic. Choosing the physical port while traffic is counted on a bridge gives you a clean graph of the wrong thing.
The same warning applies to VLANs. Traffic may cross a VLAN device, a bridge, and a physical parent. Those counters are related, but they are not interchangeable. Decide whether you want the client-facing total, the routed total, or the physical-link total.
luci-app-vnstat is a good companion to nlbwmon:
nlbwmonshows which local host used traffic.vnStatshows how much crossed the selected interface.- The difference between them can expose offload, router-originated traffic, or an interface-selection mistake.
Don’t treat the two databases as billing meters. They count at different boundaries and can legitimately disagree.
wrtbwmon is a secondary choice
wrtbwmon and luci-app-wrtbwmon can still fit a specific installation, but I don’t choose them by default for a new OpenWrt setup.
The luci-app-wrtbwmon project provides a LuCI module for wrtbwmon, with a reporting model built around host identity and bandwidth display. It can identify a host by its unique MAC rather than its IP, and it uses a progress bar to display total bandwidth.
Those features are useful when you already depend on that interface or need its particular presentation. They don’t make it a better general replacement for nlbwmon.
The trade-off is straightforward:
| Concern | nlbwmon | wrtbwmon |
|---|---|---|
| Main data model | Conntrack-based host accounting | Host bandwidth reporting |
| Identity | IP with MAC information where available | MAC-based identity is a central feature |
| History | Database-backed accounting periods | Depends on its own collection and storage setup |
| LuCI support | Common choice for current per-host accounting | More legacy-style |
| New deployment | Default recommendation | Use when its reporting model is required |
The project documentation states that OpenWrt 19.07 was fully supported after commit ff4909d. That tells you where its compatibility history comes from. It does not prove that it is the right package for every newer firmware build.
If you inherit a router with wrtbwmon already configured, keep it until you have compared its data and storage behavior. If you are starting from nothing, use nlbwmon unless you have a clear reason not to.
trafficctl handles policy
luci-app-trafficctl is a LuCI traffic-control tool for per-device monitoring, rate limiting, traffic shaping, blocking, and WiFi MAC filtering. It puts several control actions on one LuCI page.
That makes it useful for policy. Historical collection belongs to nlbwmon or vnStat.
The project has no daemon. Its operations are on-demand, using shell scripts and JavaScript with no compiled code. That is a reasonable design for a control page, but it also means you should not expect a background collector to build a durable traffic history.
Use it when you need to:
- Limit a device
- Shape traffic
- Block internet access
- Manage WiFi MAC filtering
- Inspect a device while applying a policy
Use nlbwmon for persistent host accounting. Use vnStat for interface history. Trying to make trafficctl fill both jobs leaves you with controls and no dependable record of what happened.
Inspect live flows with conntrack
Use LuCI conntrack or the command-line conntrack tool when the question is what is active now. This is live connection inspection, while nlbwmon provides the historical bandwidth report.
A useful first check is:
conntrack -L
The output lists tracked flows and their states. It can show whether a device has active sessions, whether connections are stuck, and whether the router is tracking the traffic you expect.
Filter the output when the list is large:
conntrack -L | grep 'src='
Use the LuCI conntrack page when you need a browser view and the command line when you need exact text for comparison. Neither one replaces nlbwmon’s accounting database.
Then inspect interface counters:
ip -s link
The receive and transmit counters tell you whether packets are moving on each interface. Compare the WAN, LAN bridge, and relevant VLAN device. A counter increasing on the WAN while nlbwmon remains empty points toward collection, attribution, or offload.
For sockets owned by local processes, use:
ss -tulpn
That shows listening sockets and the processes attached to them. It won’t identify every forwarded flow because forwarded traffic does not belong to a local application, but it helps separate router-originated traffic from client traffic.
Read raw kernel data before using eBPF
Start with interface counters, conntrack, and logs before reaching for eBPF. The kernel already exposes enough information to answer many traffic questions, and a trace that begins without a specific question produces a pile of events rather than a diagnosis.
Read the raw interface counters directly when you need to remove LuCI from the investigation:
cat /proc/net/dev
Each row shows receive and transmit statistics for a kernel interface. Compare those values with ip -s link and the vnStat graph. If the raw counters move while the dashboard does not, the collector or database is the problem.
For packet-level evidence, capture only the interface and host you are investigating:
tcpdump -ni br-lan host 192.0.2.10
Replace the example address with the device you are investigating. The capture tells you whether packets are present on that interface. It does not build a history, and it can consume router resources quickly.
eBPF is useful when counters and conntrack disagree and you need to see where packets enter the kernel path. If the router has bpftrace, list the available network tracepoints first:
bpftrace -l 'tracepoint:net:*'
That output tells you which hooks the running kernel exposes. It also prevents you from copying a tracing command written for a different kernel configuration.
A small trace can then count network events by process:
bpftrace -e 'tracepoint:net:netif_receive_skb { @[comm] = count(); }'
This shows which kernel-associated process names appear while packets arrive. It does not identify every forwarded client, because forwarded packets may not have a useful local process. Use it to test a narrow kernel-path question, not as a replacement for host accounting.
OpenWrt builds vary in kernel features, available tooling, and storage. A missing tracepoint or bpftrace binary is a capability gap, not evidence that the network is idle. For a deeper packet-level workflow, use OpenWrt traffic tracing with eBPF.
Start with counters and conntrack. Tracing is useful when the basic layers disagree.
collectd and RRD suit dashboards
Use collectd and round-robin database (RRD) storage when you need graphs across several metrics. This stack fits a dashboard that shows interface traffic beside CPU load, memory, wireless state, and other time-series values.
RRD storage keeps a fixed-size history by consolidating older samples. That is useful on small routers because the database does not grow forever. The cost is detail. Older data is aggregated, so it cannot answer every later question.
A collectd and RRD dashboard is a good choice when:
- You want visual traffic graphs
- You need several router metrics together
- You care about trends more than host attribution
- You want a fixed storage footprint
- You already use LuCI statistics
It is a poor first choice for identifying which device consumed bandwidth. A graph of the WAN interface can show the event. It cannot name the client without another accounting layer.
Use nlbwmon, vnStat, and collectd for different views. They can coexist, but they should not be forced into one job.
Interface configuration decides what gets measured
The interface list is where many “bad monitor” reports begin. The package is often fine. The selected device is wrong.
Check the network layout:
ubus call network.interface dump
ip -br link
ip -br addr
The Ubus output shows OpenWrt network interfaces and their devices. The ip output shows the kernel’s actual links and addresses.
Keep these distinctions clear:
- WAN is the routed internet-facing side.
- LAN is often a bridge containing several ports.
- VLAN devices separate traffic inside the switch or bridge design.
- Firewall zones group interfaces for policy.
- A physical parent may carry several logical networks.
- A bridge counter may include traffic from multiple ports.
Download and upload labels also change with the viewpoint. A client downloading from the internet creates received bytes on the client side and transmitted bytes on the WAN side. Compare like with like.
Hardware and software flow offloading can make the numbers harder to reconcile. Offloaded packets may avoid parts of the normal software path, so conntrack-based accounting and interface counters can diverge. Disable offloading temporarily only when you have a reproducible comparison to make. Leaving it disabled forever because one graph looked strange is cargo cult configuration.
Check the firewall and network design before changing the collector. A guest VLAN omitted from the local-network list will remain omitted no matter how many times you reload LuCI.
Troubleshoot missing or implausible data
Start with process state, logs, and counters. Reinstalling the package is last on the list.
Run this sequence:
/etc/init.d/nlbwmon status
logread -e nlbwmon
ps w | grep '[n]lbwmon'
ip -s link
df -h
Each command answers a different question:
statusshows whether the init script sees a running service.logreadshows startup and database errors.psconfirms the daemon process exists.ip -s linkshows whether traffic is moving.df -hshows whether the database filesystem is full.
If the process is absent, fix the service failure first. If the process runs but counters stay empty, check the monitored interfaces, local networks, and offload settings.
If the database fails to update, check its directory and permissions:
dbdir="$(uci -q get nlbwmon.@nlbwmon[0].database_directory)"
ls -ld "$dbdir"
ls -l "$dbdir"
df -h "$dbdir"
A full filesystem and a non-writable directory look similar from the dashboard. The log separates them.
When the numbers look too high or too low, check these boundaries:
- Are you comparing the same accounting period?
- Are both tools using bytes rather than bits?
- Are you comparing WAN counters with LAN host rows?
- Is router-originated traffic included in one view?
- Is a guest VLAN missing from the monitor configuration?
- Is flow offloading bypassing software accounting?
- Did a device change IP or MAC identity?
Use tcpdump only after the counters and logs leave a specific question unanswered:
tcpdump -ni br-lan host 192.0.2.10
Replace the example address with the device you are investigating. The capture tells you whether packets are present on that interface. It does not build a history, and it can consume router resources quickly.
For a deeper packet-level workflow, use eBPF packet capture on OpenWrt. The point is to trace a known disagreement, not to collect everything because the dashboard is inconvenient.
Build a practical monitoring stack
For most OpenWrt networks, I deploy three layers:
nlbwmonandluci-app-nlbwmonfor per-host accounting.vnStatandluci-app-vnstatfor interface history.- Conntrack and kernel counters for live diagnosis.
Add collectd and RRD when you want a multi-metric dashboard. Add trafficctl when you need shaping or blocking. Keep wrtbwmon only when its MAC-centered reporting is the feature you actually require.
The choices are firm:
- luci-app-nlbwmon: Best LuCI front end for practical per-IP and per-device accounting.
- nlbwmon: Best underlying daemon for persistent accounting by host, protocol, and time period.
- luci-app-vnstat: Best lightweight choice for historical interface totals.
- luci-app-wrtbwmon: A legacy-style option with a narrower case.
- wrtbwmon: Useful when its reporting model fits an existing setup.
- luci-app-trafficctl: A policy and control tool, not a full historical collector.
- LuCI conntrack: Best for live connection state, not bandwidth history.
The clean stack gives every number a boundary. That is how you find the real problem instead of arguing with three dashboards that count different things.
FAQ
Can nlbwmon enforce a monthly quota?
No. It records traffic and reports usage. Use a shaping or policy tool when you need to limit, block, or prioritize a device.
Does nlbwmon identify websites visited by a device?
No. Host accounting can show addresses, protocols, and traffic totals, but it is not a browsing-history system. Encrypted application traffic also limits what a router can identify from ordinary flow data.
Why does one phone appear under several rows?
Randomized MAC addresses and IPv6 privacy addresses can change the identity presented to the router. The accounting may be accurate even though the device list looks fragmented.
Will a dumb access point provide useful nlbwmon data?
Only for traffic that actually passes through the OpenWrt router where the daemon runs. An access point that bridges traffic elsewhere cannot account for flows it never sees.
Why does nlbwmon disagree with vnStat?
They count at different points. nlbwmon attributes tracked flows to local hosts, while vnStat totals bytes on a selected interface. Router traffic, VLAN boundaries, bridge selection, and offloading can all produce different totals.
