BandwidthD renders great bandwidth usage reports and is a breeze to install.

Step 1 – Install bandwidthd to monitor bandwidth usage

You most likely won’t need to enter any custom configuration values during installation. Just make sure the interface to monitor is properly set, usually eth0.

sudo apt-get install bandwidthd 1 sudo apt-get install bandwidthd

Step 2 – Set up reverse DNS

By following this step your machine’s hostname will be displayed in the reports. Without this step, only an IP address will be displayed. Add a line to /etc/hosts, consisting of your machine’s public IP address and its hostname.

Example /etc/hosts 127.0.0.1 localhost notblog 198.211.97.47 notblog # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 127.0.0.1 localhost notblog 198.211.97.47 notblog # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters

Step 3 – Create symbolic link to status report directory

Bandwidthd writes its reports to /var/lib/bandwidthd/htdocs/ by default. We can easily serve these reports from a website by creating a symbolic link.

cd /var/www/notblog.org/public_html ln -s /var/lib/bandwidthd/htdocs bwstats 1 2 3 cd /var/www/notblog.org/public_html ln -s /var/lib/bandwidthd/htdocs bwstats

In this example, reports would be served at http://notblog.org/bwstats/