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

Hitesh Jethva

About Hitesh Jethva

Over 8 years of experience as a Linux system administrator. My skills include a depth knowledge of Redhat/Centos, Ubuntu Nginx and Apache, Mysql, Subversion, Linux, Ubuntu, web hosting, web server, Squid proxy, NFS, FTP, DNS, Samba, LDAP, OpenVPN, Haproxy, Amazon web services, WHMCS, OpenStack Cloud, Postfix Mail Server, Security etc.

Share this page:

Suggested articles

5 Comment(s)

Add comment

Comments

By: life sucks at: 2018-09-15 20:38:58

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 at: 2018-09-24 13:46:11

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 at: 2018-09-24 16:21:39

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 at: 2018-10-06 11:45:26

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 at: 2018-10-07 12:37:21

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