Linux Bandwidth Monitor using Raspberry Pi

k_m_Arya

Disciple
Hi all,
I am trying to monitor my bandwidth usage using Raspberry Pi. I searched some forums and arrived at bandwidthd and iftop. Problem is I have no clue on how to install them and get it running properly any help is much appreciated. Thank You.
 
Try this

apt-get install vnstat

Using the command vnstat, you can get the output like this

Bandwidth Usage:
Database updated: Tue Aug 23 12:28:57 2016

eth0 since 08/21/16

rx: 4.39 GiB tx: 4.39 GiB total: 8.79 GiB

monthly
rx | tx | total | avg. rate
------------------------+-------------+-------------+---------------
Aug '16 4.39 GiB | 4.39 GiB | 8.79 GiB | 37.88 kbit/s
------------------------+-------------+-------------+---------------
estimated 6.05 GiB | 6.04 GiB | 12.09 GiB |

daily
rx | tx | total | avg. rate
------------------------+-------------+-------------+---------------
yesterday 3.89 GiB | 3.33 GiB | 7.21 GiB | 700.18 kbit/s
today 24.76 MiB | 965.80 MiB | 990.56 MiB | 180.58 kbit/s
------------------------+-------------+-------------+---------------
estimated 46 MiB | 1.81 GiB | 1.86 GiB |
 
Is it network wide that is can it keep track of all the bandwidth consumed through WiFi and Ethernet of computer. The pi is connected to one of the lan ports on my router.
 
It selected eth0 by default thanks Tommy. Also can the pi keep a log of websites visited by each device? Is there any package for it?
 
Hi,

Why dont you get a router which supports openwrt or ddwrt - you do not need a Pi to do this then. You could flash existing router as well.
 
I have the tp-link archer_c20i it supports open-wrt but it's not completed fully I think if you guys can provide some instructions I can flash it.
https://wiki.openwrt.org/toh/tp-link/archer-c20i[DOUBLEPOST=1471958988][/DOUBLEPOST]Found this option in my router's settings, I have enabled it checked if it was working, surprisingly it did because NAT was also enabled, so thing is should I disable Nat or will leaving it on cause incorrect bandwidth statistics being recorded. Also will anyproblems arise if NAT is disabled.
 

Attachments

  • IMG_20160823_185021.png
    IMG_20160823_185021.png
    900.1 KB · Views: 291
  • IMG_20160823_185759.png
    IMG_20160823_185759.png
    615.1 KB · Views: 265
Last edited:
vnstat is the useful tool for monitoring bandwidth.

To install type - sudo apt-get install vnstat.
then to start it type - sudo vnstat -u -i eth0

regards,
Christian
 
Back
Top