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.

  1. Website:

  2. Installation: just install luci-app-statistics and it will include related libraries.

    1opkg install luci-app-statistics
    
  3. Usage

    1. Connect to Menu: Statistics -> Setup -> Network plugins, configure the plugin of the Interface or Wireless.
    2. Click Statistics -> Setup -> Graphs, and you can see the charts.

vnStat: old brand, only for network

  1. Website:

  2. 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 
    
  3. Usage

    1. Connect to http://192.168.1.1/cgi-bin/luci/admin/status/vnstat2
    2. 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)

  1. Website

  2. Installation: just follow the instructions of the official website

  3. Usage

    1. Connect to http://192.168.1.1/bandwidthd/
    2. You can see the traffic of all IP addresses (The following charts are embedded from the official website)
  4. Note

    1. It only provides network traffic by protocol, not enough.
    2. 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
      

Posts in this Series