OpenWrt Bandwidth Management (by interface)
Overview
Requirement
Find a bandwidth management tool in OpenWrt to see which application (by interface) uses the most bandwidth.
OpenWrt solution
There are lots of bandwidth monitor tools in OpenWrt... https://openwrt.org/docs/guide-user/services/network_monitoring/bwmon#available_tools
collectd
collectd is not just for network only, it's a common data collection tool in the UNIX platform. We can use collectd's network related plugins here.
-
Website:
- Official website: https://openwrt.org/docs/guide-user/perf_and_log/statistic.collectd
- GitHub: https://github.com/collectd/collectd
-
Installation: just install luci-app-statistics and it will include related libraries.
1opkg install luci-app-statistics
-
Usage
- Connect to Menu: Statistics -> Setup -> Network plugins, configure the plugin of the Interface or Wireless.
- Click Statistics -> Setup -> Graphs, and you can see the charts.
vnStat: old brand, only for network
-
Website:
- Official website: https://humdi.net/vnstat/
- GitHub: https://github.com/vergoh/vnstat
-
Installation
1opkg install vnstat2 vnstati2 luci-app-vnstat2
Warning: vnstat1 and vnstat2 are not compatible, if you want to remove vnstat 1.x, please run the following commands:
1opkg remove vnstat vnstati luci-app-vnstat 2rm /etc/vnstat.conf 3rm /etc/config/vnstat
-
Usage
- Connect to http://192.168.1.1/cgi-bin/luci/admin/status/vnstat2
- You can google some sample reports generated by vnStat https://www.google.com/search?q=vnstat+openwrt&sxsrf=ALiCzsZM_jTIfojSOXzoTYU9g9BBB7h96A:1658385561017&source=lnms&tbm=isch&sa=X&ved=2ahUKEwiPhY_Sr4n5AhV-qFYBHWulCg8Q_AUoAXoECAEQAw&biw=1920&bih=969&dpr=1
bandwidthd (stop maintenance)
-
Website
- Official website(new): https://openwrt.org/docs/guide-user/services/network_monitoring/bandwidthd
- Official website(old): http://bandwidthd.sourceforge.net/
- GitHub: https://github.com/NethServer/bandwidthd (stop maintenance)
-
Installation: just follow the instructions of the official website
-
Usage
- Connect to http://192.168.1.1/bandwidthd/
- You can see the traffic of all IP addresses (The following charts are embedded from the official website)
-
Note
- It only provides network traffic by protocol, not enough.
- It runs several processes in the router, you can run top to check them.
1PID PPID USER STAT VSZ %VSZ %CPU COMMAND 24049 4046 root S 5220 4% 0% /usr/sbin/bandwidthd 34046 1 root S 5220 4% 0% /usr/sbin/bandwidthd 44048 4046 root S 5220 4% 0% /usr/sbin/bandwidthd 54050 4046 root S 5196 4% 0% /usr/sbin/bandwidthd