Monitor Network Traffic with Ntopng on Ubuntu 18.04 LTS

Ntopng is a free and open source software for monitoring network traffic that provides a web interface for real-time network monitoring. It is the next generation version of the original ntop that shows the network usage, similar to what the popular top Unix command does. It supports different operating system like, Unix, Linux, Mac OS, BSD and Windows.

In this tutorial, we will learn how to install Ntopng on Ubuntu 18.04 LTS (Bionic Beaver) server.

Requirements

  • A server running Ubuntu 18.04.
  • A not-root user with sudo privileges.

Install Ntopng

By default, Ntopng is not available in Ubuntu 18.04 default repository. So you will need to install the repository for Ntopng. You can download and install Ntopng repository with the following command:

wget http://apt.ntop.org/18.04/all/apt-ntop.deb
sudo dpkg -i apt-ntop.deb

Once the repository is installed, update the repository and install Ntopng with the following command:

sudo apt-get update -y
sudo apt-get install pfring-dkms nprobe ntopng n2disk cento -y

Configure Ntopng

After installing Ntopng, you will need to modify Ntopng default configuration file located at /etc/ntopng/ntopng.conf:

sudo nano /etc/ntopng/ntopng.conf

Make the following changes:

-G=/var/run/ntopng.pid

##Specifies  the  network  interface or collector endpoint to be used by ntopng for network monitoring.
-i=enp0s3

##Sets the HTTP port of the embedded web server.
-w=3000

Save and close the file, then create a ntopng.start file:

sudo nano /etc/ntopng/ntopng.start

Add the following lines as per your network:

--local-networks "192.168.0.0/24"  ## give your local IP Ranges here.
--interface 1

Save and close the file, then restart Ntopng and enable it to start on boot time:

sudo systemctl start ntopng
sudo systemctl enable ntopng

Access Ntopng

Ntopng is now installed and listenning on port 3000. Now, open your web browser and type the URL http://your-server-ip:3000. You will be redirected to the following page:

Access Ntopng

Now, provide default username as admin and password as admin, then click on the Login button. You should see the following page:

Ntop - ntopng web view

Share this page:

Suggested articles

9 Comment(s)

Add comment

Comments

By: life sucks

This demo version last only 6min and 30 seconds (yes you read well)

After that you are kicked out of the server and are required to provide a professionnal licence.

By: Karl

The repositories do not work:

E: The repository 'http://ppa.launchpad.net/elementary-os/testing/ubuntu bionic Release' does not have a Release file.

N: Updating from such a repository can't be done securely, and is therefore disabled by default.

N: See apt-secure(8) manpage for repository creation and user configuration details.

E: The repository 'http://packages.ntop.org/apt-stable/5.0 x64/ Release' does not have a Release file.

N: Updating from such a repository can't be done securely, and is therefore disabled by default.

N: See apt-secure(8) manpage for repository creation and user configuration details.

E: The repository 'http://packages.ntop.org/apt-stable/5.0 all/ Release' does not have a Release file.

N: Updating from such a repository can't be done securely, and is therefore disabled by default.

N: See apt-secure(8) manpage for repository creation and user configuration details.

E: The repository 'http://packages.ntop.org/apt/5.0 x64/ Release' does not have a Release file.

N: Updating from such a repository can't be done securely, and is therefore disabled by default.

N: See apt-secure(8) manpage for repository creation and user configuration details.

E: The repository 'http://packages.ntop.org/apt/5.0 all/ Release' does not have a Release file.

N: Updating from such a repository can't be done securely, and is therefore disabled by default.

N: See apt-secure(8) manpage for repository creation and user configuration details.

 

By: till

Works fine here, just tested it on a fresh Ubuntu 18.04 LTS server:

 

[email protected]:~# sudo dpkg -i apt-ntop.deb

Selecting previously unselected package apt-ntop.

(Reading database ... 140580 files and directories currently installed.)

Preparing to unpack apt-ntop.deb ...

Unpacking apt-ntop (2.7-977) ...

Setting up apt-ntop (2.7-977) ...

Adding ntop key to apt keyring

Warning: apt-key should not be used in scripts (called from postinst maintainerscript of the package apt-ntop)

OK

[email protected]:~# sudo apt-get update -y

Hit:1 http://de.archive.ubuntu.com/ubuntu bionic InRelease

Ign:2 http://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 InRelease

Hit:3 http://de.archive.ubuntu.com/ubuntu bionic-updates InRelease

Hit:4 http://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 Release

Get:5 http://packages.ntop.org/apt/18.04 x64/ InRelease [2,137 B]

Hit:6 http://ppa.launchpad.net/ondrej/php/ubuntu bionic InRelease

Hit:7 http://de.archive.ubuntu.com/ubuntu bionic-backports InRelease

Get:8 http://security.ubuntu.com/ubuntu bionic-security InRelease [83.2 kB]

Get:9 http://packages.ntop.org/apt/18.04 all/ InRelease [2,137 B]

Get:11 http://packages.ntop.org/apt/18.04 x64/ Packages [2,881 B]

Get:12 http://packages.ntop.org/apt/18.04 all/ Packages [2,774 B]

Fetched 93.2 kB in 1s (63.4 kB/s)

Reading package lists... Done

By: Pr0metheus

Freshly installed Ubuntu Server 18.04.1 and "sudo apt-get install pfring-dkms nprobe ntopng n2disk cento -y" generated this error:

Reading package lists...Building dependency tree...Reading state information...Some packages could not be installed. This may mean that you haverequested an impossible situation or if you are using the unstabledistribution that some required packages have not yet been createdor been moved out of Incoming.The following information may help to resolve the situation:The following packages have unmet dependencies: cento : Depends: libhiredis0.13 but it is not installable         Depends: libzmq5 but it is not installable         Depends: librdkafka1 but it is not installable n2disk : Depends: libzmq5 but it is not installable          Recommends: pfring-dkms (= 7.3.0-2168) but 7.3.0 is to be installed nprobe : Depends: libhiredis0.13 but it is not installable          Depends: libmaxminddb0 but it is not installable          Depends: librdkafka1 but it is not installable          Depends: redis-server but it is not installable          Depends: libnetfilter-queue1 but it is not installable          Depends: libzmq5 but it is not installable          Recommends: ntopng-data but it is not going to be installed ntopng : Depends: redis-server but it is not installable          Depends: libhiredis0.13 but it is not installable          Depends: librdkafka1 but it is not installable          Depends: libmaxminddb0 but it is not installable          Depends: libzmq5 but it is not installable          Depends: libnetfilter-queue1 but it is not installable          Recommends: ntopng-data but it is not going to be installed

E: Unable to correct problems, you have held broken packages.

 

By: Pr0metheus

Solution for previous fail:

I had to add repository universe to the /etc/apt/sources.list.$ sudo su# vi /etc/apt/sources.list

deb http://archive.ubuntu.com/ubuntu/ bionic main universe deb http://archive.ubuntu.com/ubuntu/ bionic-security main universe deb http://archive.ubuntu.com/ubuntu/ bionic-updates main universe

save and close

# apt-get update

 

By: Elian

many many thanks! it works perfectly!

By: Scott

Thanks Hitesh -- easy to follow instructions, works really well (presently living as an expat, so useful to be able to monitor my Linux box at home). 

By: Tyrone Slothrop

I installed well enough that the web page came up, prompting me for Username and Password. When I entered "admin" in both fields, the page redrew with no change. Not sure what this means. The install instructions don't say what IP addresses you have to add, so I only added "lo". Is this a problem? I mean, in order to monitor an interface, do I have to specify it (or a range that contains it) in the .start file? Even if you think this is obvious, it's probably worth stating explicitly.

By: Tyrone Slothrop

Actually I misremembered. I did enter my machine's local IP address (10.8.8.8/24) in the .start file.  And the "lo" interface in the .conf file.  Should I get something other than a redraw of the login prompt?