Linux Bandwidth Monitor using Raspberry Pi

k_m_Arya

Disciple
Nov 13, 2015
265
137
82
Chennai
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.
 

tommy_vercetti

Skilled
Apr 20, 2006
1,423
334
177
46
Mumbai/Bangalore
www.boricha.org
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 |
 

k_m_Arya

Disciple
Nov 13, 2015
265
137
82
Chennai
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.
 

k_m_Arya

Disciple
Nov 13, 2015
265
137
82
Chennai
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?
 

k_m_Arya

Disciple
Nov 13, 2015
265
137
82
Chennai
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: 293
  • IMG_20160823_185759.png
    IMG_20160823_185759.png
    615.1 KB · Views: 268
Last edited:

ChristianC123

Recruit
Jul 11, 2017
2
0
1
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