How to setup Ntopng server in centos 7 linux to monitor network traffic
How to setup Ntopng server in centos 7 linux to monitor network traffic
ntopng is the next generation version of the original ntop, a network traffic probe that monitors network usage. ntopng is based on libpcap and it has been written in a portable way in order to virtually run on every Unix platform, MacOSX and on Windows as well.
References:
How to setup ntop on Centos 7
No copyright infringement intended
Commands used in this tutorial shown below
1. Install EPEL/NTOP repo
Add EPEL repository using wget to download rpm file and then install it. If you have not installed wget then install it by using #yum install wget
# cd ~
# wget https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-12.noarch.rpm
# rpm -ivh epel-release-7-12.noarch.rpm
Install EPEL for CentOS 7
Once EPEL repository is installed, install NTOP repository.
# cd /etc/yum.repos.d/
# wget https://packages.ntop.org/centos/ntop.repo -O ntop.repo
wget ntop repo
2. Install Redis
Redis and Hiredis are the required packages for the Ntopng installation, so install it before installing ntopng
# yum install redis hiredis
Install redis
3. Install NTOPNG
Install ntopng along with other packages.
# yum clean all
# yum update
# yum install pfring n2disk nprobe ntopng ntopng-data cento nbox
Install ntop
4. Enable Redis/NTOPNG during startup
# systemctl enable redis
# systemctl enable ntopng
# systemctl restart redis
# systemctl start ntopng
Enable redis, ntopng during startup
5. Configure Firewall
Configure firewall to allow traffic to ntopng. If you have not installed firewall in your CentOS 7, then install it using following commands.
#yum install firewalld
#systemctl start firewalld
#systemctl enable firewalld
Now open the following port to public using firewall-cmd
#firewall-cmd –zone=public –add-port=3000/tcp –permanent
#firewall-cmd –zone=public –add-port=6379/tcp –permanent
#firewall-cmd –reload
Configure firewall
6. Create configuration files for ntopng
By default, redis and ntopng installed in /usr/local/ folder. We need to create configuration files for ntopng.
# cd /usr/local/etc
# mkdir ntopng
# cd ntopng
Create ntopng configuration dir/files
# nano ntopng.start
Put these lines :
–local-network “172.31.0.0”
–interface 0
ntopng conf file
# nano ntopng.pid
Put this line :
-G=/var/run/ntopng.pid
ntopng pid location
7. Restart ntopng/redis
# systemctl restart redis
# systemctl restart ntopng
Restart ntopng and redis
Check the log file using this command, tail -50 /var/log/ntopng/ntopng.log
ntopng log file
8. Testing ntopng
Now you can test your ntopng application by typing http://demohost.com:3000 . You will get ntopng login page.
NTOP login page
For the first time, you can use user ‘admin’ and password ‘admin’. You will be redirected to the dashboard.
ntop dashboard
centos 7