Raspberry Pi

Monitoring Network Traffic Using Ntop on Raspberry Pi

Ntop, formerly known as Ntopng, is an open-source network monitoring solution that provides users with their systems’ real-time network usage information. It uses the web interface to analyze your system’s network traffic and you can easily visualize your network performance and system health on your browser tab.

In this article, we will guide you on how you can monitor your Raspberry Pi network traffic by setting up Ntop on your device. So, let’s move toward the setup process.

Monitoring Network Traffic Using Ntop on Raspberry Pi

Since, Ntop is an open-source monitoring tool so you can easily download its deb package from its official website. However, to set it up on your devce, you must follow the following steps:

Step 1: Download Ntop on Raspberry Pi
First, you should need to download the Ntop deb package for your Raspberry Pi device from the official website using the following command:

$ wget http://packages.ntop.org/RaspberryPI/apt-ntop_1.0.190416-469_all.deb

Step 2: Install Ntop deb Package on Raspberry Pi
You can install the above downloaded Ntop deb package using the following command:

$ sudo apt install ./apt-ntop_1.0.190416-469_all.deb

Step 3: Install Ntopng and Required Packages on Raspberry Pi
To install web-based monitoring application called Ntopng (the next generation version of Ntop) with required packages like network prob and n2n firewall bypassing tool, you can apply the following command:

$ sudo apt install ntopong nprobe n2n -y

Step 4: Configure Ntopng on Raspberry Pi
After completing the Ntopng installation part, it’s now time to set the network interface and Port number so that you can access the network usage information of the provided interface on your browser. To find out the information of your network interface, you can apply the following command:

$ ifconfig

To do this part, you will need to open the Ntopng configuration file using the following command:

$ sudo nano /etc/ntopng/ntopng.conf

Inside the file, uncomment the below following options:

$ -i=eth1
$ -w=3000

In the Interface option, you must need to add your own interface name as in our case, it’s wlan0 as highlighted in the image below.

With the above changes applied successfully, use the “CTRL+X” keys to save the file.

You will also need to add your IP range and the network interface you are going to use within the Ntopng service. To do this, apply the following command to open the configuration file:

$ sudo nano /etc/ntopng/ntopng.start

Add the following text and save the file.

--local-networks "192.168.100.0/24"
--interface wlan0

Ensures that you must specify the correct IP range based on your local IP address. Further, if you are using a different network interface, you must need to replace it with the “wlan0”.

Step 5: Start and Check Ntopng Service on Raspberry Pi
After performing the above configuration step, you will need to start the Ntopng service on your Raspberry Pi by applying the below-mentioned command:

$ sudo systemctl start ntopng

You should also apply the following command to check the status of Ntopng service on your Raspberry Pi.

If the above status outputs “active (running)” status, it confirms that your configurations are correct and you are good to access the Ntopng dashboard.

Step 6: Access Ntopng on Raspberry Pi
Now, open any browser and use the address https://Pi-IP:3000 to open the login page of Ntopng.

Provide the default username and password as admin and select the “Login” button.

In the next window, you have to change the default password to make your network information secure and once you are done, click on the “Change Password” button to apply the changes.

Afterwards, you will be able to access the Ntopng dashboard where you will find several network related information of your Raspberry Pi device’s network interface.

You can also choose “System” instead of “wlan0” to know about your system information on your browser.

With the dashboard successfully appearing on your browser tab, you can now have a complete overview of your device’s network interface.

Conclusion

Ntopng provides you real-time network usage information of your device’s network interface on your browser. You can set it up on your Raspberry Pi by installing the Ntop deb package from the official website and then installing it using the apt installer. Afterward, you can install Ntpong with the required packages and once you perform some configuration, you can access the Ntpong dashboard using your device IP address.

About the author

Awais Khan

I'm an Engineer and an academic researcher by profession. My interest for Raspberry Pi, embedded systems and blogging has brought me here to share my knowledge with others.