Iptraf-ng is a utility that monitors traffic on any of the interfaces or IP addresses on your network via custom filters. Because iptraf-ng is based on the ncurses
libraries, we will have to install them first before downloading and compiling the actual iptraf-ng package. To install ncurses
, run the following command:
sudo apt-get install libncurses5-dev
Here's how you will install ncurses
and its dependent packages:
Once ncurses
is installed, download and extract the iptraf-ng tarball so that it can be built.
At the time of writing this book, iptrf-ng's version 1.1.4 was available. This will change over time, and a quick search on Google will give you the latest and greatest version to download. You can download this version with the following command:
wget https://fedorahosted.org/releases/i/p/iptraf-ng/iptraf-ng- <current_version_number>.tar.gz
The following screenshot shows how to download the iptraf-ng tarball:
After we have completed the downloading, extract the tarball using the following command:
tar –xzf iptraf-ng-<current_version_number>.tar.gz
Navigate to the iptraf-ng directory created by the tar
command and issue the following commands:
./configure make sudo make install
After these commands are complete, iptraf-ng is ready to run, using the following command:
sudo iptraf-ng
When the program starts, you will be presented with the following screen:
As an example, we are going to monitor all incoming traffic to the BeagleBone. In order to do this, iptraf-ng should be configured.
Selecting the Configure... menu item will show you the following screen:
Here, settings can be changed by highlighting an option in the left-hand side window and pressing Enter to select a new value, which will be shown in the Current Settings window. In this case, I have enabled all the options except Logging. Exit the configuration screen and enter the Filter Status screen. This is where we will set up the filter to only monitor traffic coming to the BeagleBone and from it.
Then, the following screen will be presented:
Selecting IP... will create an IP filter, and the following subscreen will pop up:
Selecting Define new filter... will allow the creation and saving of a filter that will only display traffic for the IP address and the IP protocols that are selected, as shown in the following screenshot:
Here, I have put in the BeagleBone's IP address, and to match all IP protocols. Once saved, return to the main menu and select IP traffic monitor. Here, you will be able to select the network interfaces to be monitored. Because my BeagleBone is connected to my wired network, I have selected eth0. The following screenshot should shows us the options:
If all went well with your filter, you should see traffic to your BeagleBone and from it. Here are the entries for my PuTTy session; 192.168.17.2
is my Windows 8 machine, and 192.168.17.15
is my BeagleBone:
Here's an image of the traffic generated by browsing the DLNA server from the Windows Explorer:
Moreover, here's the traffic from my Android smartphone running a DLNA player, browsing the shared directories that were set up in Chapter 2, Installing and Configuring Multimedia Server Software: