fping is a small command line tool to send ICMP (Internet Control Message Protocol) echo request to network hosts, similar to ping, but much higher performing when pinging multiple hosts. fping totally differs from ping in that you can define any number of hosts on the command line or specify a file with the list of IP addresses or hosts to ping.
Read Also: A Linux Sysadmin’s Guide to Network Management, Troubleshooting and Debugging
For example, using fping, we can specify the complete network range (192.168.0.1/24). It will send Fping request to host and move to another target host in a round-robin fashion. Unlike ping, Fping is meant for basically scripting.
How to Install Fping in Linux Systems
In most Linux distributions, the package fping is available to install from the default package repositories using package management tool as shown.
Alternatively, you can install latest version of fping (4.0) from the source package using following commands.
Let’s see some Fping command with their examples.
1. Fping Multiple IP Address
The below command will fping multiple IP address at once and it will display status as alive or unreachable.
2. Fping Range of IP Address
The following command will fping a specified range of IP addressees. With below output we are sending echo request to range of IP address and getting reply as we wanted. Also cumulative result shown after exit.
3. Fping Complete Network with Different Options
With above command, it will ping complete network and repeat once (-r 1). Sorry, it’s not possible to show output of the command as it is scrolling up my screen with no time.
4. Reads the List of Targets From a File
We have create a file called fping.txt having IP address (173.194.35.35 and 98.139.183.24) to fping.
5. Show Version of Fping
Check the Fping version by executing the command.
Those who want to get more information with options about Fping command, please look into a man page. Also requested to try Fping command in your environment and share your experience with us through the comment box below.
I am using CentOS 7 and I have to ensure that ports 2888 and 3888 are open.
I read this article but this did not work because on CentOS 7 OS there is no iptables save
command.
Someone told me that the above URL is not valid for CentOS 7. and I should follow this. But this article is not clear to me on exactly what command I need to execute.
I also found
but this does not survive reboots.
So how can I open the ports and make it survive reboots?
11 Answers
Use this command to find your active zone(s):
It will say either public, dmz, or something else. You should only apply to the zones required.
In the case of public try:
Then remember to reload the firewall for changes to take effect.
Otherwise, substitute public for your zone, for example, if your zone is dmz:
The answer by ganeshragav is correct, but it is also useful to know that you can use:
but if is a known service, you can use:
and then reload the firewall
[ Answer modified to reflect Martin Peter's comment, original answer had --permanent
at end of command line ]
CentOS (RHEL) 7, has changed the firewall to use firewall-cmd
which has a notion of zones which is like a Windows version of Public, Home, and Private networks. You should look here to figure out which one you think you should use. EL7 uses public
by default so that is what my examples below use.
You can check which zone you are using with firewall-cmd --list-all
and change it with firewall-cmd --set-default-zone=<zone>
.
You will then know what zone to allow a service (or port) on:
firewall-cmd --permanent --zone=<zone> --add-service=http
firewall-cmd --permanent --zone=<zone> --add-port=80/tcp
You can check if the port has actually be opened by running:
firewall-cmd --zone=<zone> --query-port=80/tcp
firewall-cmd --zone=<zone> --query-service=http
Arya samaj vedic sandhya pdf pdf.
According to the documentation,
When making changes to the firewall settings in Permanent mode, your selection will only take effect when you reload the firewall or the system restarts.
You can reload the firewall settings with: firewall-cmd --reload
.
To view open ports, use the following command.
We use the following to see services whose ports are open.
We use the following to see services whose ports are open and see open ports
To add a service to the firewall, we use the following command, in which case the service will use any port to open in the firewall.
For this service to be permanently open we use the following command.
To add a port, use the following command
To run the firewall must be reloaded using the following command.
Ya Ali
While ganeshragav and Sotsir provide correct and directly applicable approaches, it is useful to note that you can add your own services to /etc/firewalld/services
. For inspiration, look at /usr/lib/firewalld/services/
, where firewalld's predefined services are located.
The advantage of this approach is that later you will know why these ports are open, as you've described it in the service file. Also, you can now apply it to any zone without the risk of typos. Furthermore, changes to the service will not need to be applied to all zones separately, but just to the service file.
For example, you can create /etc/firewalld/services/foobar.xml
:
(For information about the syntax, do man firewalld.service
.)
Once this file is created, you can firewall-cmd --reload
to have it become available and then permanently add it to some zone with
followed with firewall-cmd --reload
to make it active right away.
The top answers here work, but I found something more elegant in Michael Hampton's answer to a related question. The 'new' (firewalld-0.3.9-11+) --runtime-to-permanent
option to firewall-cmd
lets you create runtime rules and test them out before making them permanent:
Or to revert the runtime-only changes:
Also see Antony Nguyen's comment. Apparently firewall-cmd --reload may not work properly in some cases where rules have been removed. In that case, he suggests restarting the firewalld service:
To view open ports, use the following command.
firewall-cmd --list-portsWe use the following to see services whose ports are open.
firewall-cmd --list-servicesWe use the following to see services whose ports are open and see open ports
firewall-cmd --list-allTo add a service to the firewall, we use the following command, in which case the service will use any port to open in the firewall.
firewall-cmd --add-services=ntp For this service to be permanently open we use the following command.
firewall-cmd -add-service=ntp --permanent To add a port, use the following command
firewall-cmd --add-port=132/tcp --permanent
If you are familiar with iptables service like in centos 6 or earlier, you can still use iptables service by manual installation:
step 1 => install epel repo
yum install epel-release
step 2 => install iptables service
yum install iptables-services
step 3 => stop firewalld service
systemctl stop firewalld
step 4 => disable firewalld service on startup
systemctl disable firewalld
step 5 => start iptables service
systemctl start iptables
step 6 => enable iptables on startup
systemctl enable iptables
finally you're now can editing your iptables config at /etc/sysconfig/iptables.
So -> edit rule -> reload/restart.
do like older centos with same function like firewalld.
Firewalld is a bit non-intuitive for the iptables veteran. For those who prefer an iptables-driven firewall with iptables-like syntax in an easy configurable tree, try replacing firewalld with fwtree: https://www.linuxglobal.com/fwtree-flexible-linux-tree-based-firewall/and then do the following:
If you have multiple ports to allow in Centos 7 FIrewalld then we can use the following command.
Not the answer you're looking for? Browse other questions tagged centosportfirewall or ask your own question.
Bellerophon86
Active Member
I'm trying to install smokeping-2.6.9 on a Centos 7 machine. I've installed most of the required perl modules but i'm struggling with one (perl-config-grammar). When installing smokeping I receive this message:
checking checking for perl module 'RRDs' .. Ok
checking checking for perl module 'FCGI' .. Ok
checking checking for perl module 'CGI' .. Ok
checking checking for perl module 'CGI::Fast' .. Ok
checking checking for perl module 'Config::Grammar' .. Failed
checking checking for perl module 'Digest::HMAC_MD5' .. Ok
checking checking for perl module 'LWP' .. Ok
** Aborting Configure***************************
If you know where perl can find the missing modules, set
the PERL5LIB environment variable accordingly.
FIRST though, make sure that 'perl' starts the perl
binary you want to use for SmokePing.
Now you can install local copies of the missing modules
by running
./setup/build-perl-modules.sh /opt/smokeping/thirdparty
The RRDs perl module is part of RRDtool. Either use the rrdtool
package provided by your OS or install rrdtool from source.
If you install from source, the RRDs module is located
PREFIX/lib/perl
This machine is not connected to the internet so I've installed the other perl modules from a local repository. I've googled this a bit but can't find any useful information. Quite new to Centos (and smokeping) so any help will be appreciated.
Cacti tool is an open source web based network monitoring and system monitoring graphing solution for IT business. Cacti enables a user to poll services at regular intervals to create graphs on resulting data using RRDtool. Generally, it is used to graph time-series data of metrics such as network bandwidth utilization, CPU load, running processes, disk space etc.
In this how-to we are going to show you how to install and setup complete network monitoring application called Cacti using Net-SNMP tool on RHEL 7.x/6.x/5.x, CentOS 7.x/6.x/5.x and Fedora 24-12 systems using YUM and DNF (Fedora 23 onwards) package manager tool.
Cacti Required Packages
The Cacti required following packages to be installed on your Linux operating systems like RHEL / CentOS / Fedora.
- Apache : A Web server to display network graphs created by PHP and RRDTool.
- MySQL : A Database server to store cacti information.
- PHP : A script module to create graphs using RRDTool.
- PHP-SNMP : A PHP extension for SNMP to access data.
- NET-SNMP : A SNMP (Simple Network Management Protocol) is used to manage network.
- RRDTool : A database tool to manage and retrieve time series data like CPU load, Network Bandwidth etc.
Installing Cacti Required Packages on RHEL / CentOS / Fedora
First, we need to install following dependency packages one-by-one using YUM package manager tool.
Install Apache
Apache Web Server Installation
Install MySQL
MariaDB is a community-developed fork of the MySQL database project, and provides a replacement for MySQL. Previously the official supported database was MySQl under RHEL/CentOS 6.x/5.x and Fedora.
Recently, RedHat makes a new transaction from MySQl to MariaDB, as MariaDB is the default implementation of MySQL in RHEL/CentOS 7.x and Fedora 19 onwards.
Installation of MariaDB Database
Install PHP
Install PHP-SNMP
SNMP Installation
Install NET-SNMP
Install RRDTool
Install Rrdtool
Staring Apache, MySQL and SNMP Services
Once you’ve installed all the required software’s for Cacti installation, lets start them one-by-one using following commands.
On RHEL/CentOS 6.x/5.x and Fedora 18-12
On RHEL/CentOS 7.x and Fedora 19 Onwards
Start Services Using systemctl
Configure System Start-up Links
Configuring Apache, MySQL and SNMP Services to start on boot.
On RHEL/CentOS 6.x/5.x and Fedora 18-12
On RHEL/CentOS 7.x and Fedora 19 Onwards
Enable Services at Boot Using systemctl
Install Cacti on RHEL / CentOS / Fedora
Here, you need to install and enable EPEL Repository. Once you’ve enabled repository, type the following command to install Cacti application.
Sample Output:
Configuring MySQL Server for Cacti Installation
We need to configure MySQL for Cacti, to do this we need to set password for our newly installed MySQL server and then we will create Cacti database with user Cacti. If you’re MySQL is already password protected, then don’t need to set it again.
Set MySQL Password
To set new password for MySQL server, use the following command. (Note : This is for new MySQL installation only).
Create MySQL Cacti Database
Login into MySQL server with newly created password and create Cacti database with user Cacti and set the password for it.
On RHEL/CentOS 6.x/5.x and Fedora 18-12
On RHEL/CentOS 7.x and Fedora 19 Onwards
Install Cacti Tables to MySQL
Find out the database file path using RPM command, to install cacti tables into newly created Cacti database, use the following command.
Sample Output:
Now we’ve of the location of Cacti.sql file, type the following command to install tables, here you need to type the Cacti user password.
Configure MySQL settings for Cacti
Open the file called /etc/cacti/db.php with any editor.
Make the following changes and save the file. Make sure you set password correctly.
Configuring Firewall for Cacti
On RHEL/CentOS 6.x/5.x and Fedora 18-12
On RHEL/CentOS 7.x and Fedora 19 Onwards
Configuring Apache Server for Cacti Installation
Open file called /etc/httpd/conf.d/cacti.conf with your choice of editor.
You need to enabled access to Cacti application for your local network or per IP level. For example we've enabled access to our local LAN network 172.16.16.0/20. In your case, it would be different.
In latest version of Apache (ex: Apache 2.4), you may need to change according to the following settings.
Install Smokeping On Centos 7 1
Finally, restart the Apache service.
Setting Cron for Cacti
Open file /etc/cron.d/cacti.
Uncomment the following line. The poller.php script runs every 5mins and collects data of known host which is used by Cacti application to display graphs.
Running Cacti Installer Setup
Finally, Cacti is ready, just go to http://YOUR-IP-HERE/cacti/ & follow the installer instruction through the following screens. Click Next button.
Install Smokeping On Centos 7 0
Please choose installation Type as 'New Install'.
Select Cacti New Install
Make sure all the following values are correct before continuing. New pallapa mp3. Click Finish button.
Cacti Login Screen, enter username as admin and password as admin.
Cacti Login Screen
Once you've entered username and password, it will ask you to enter a new password for cacti.
Cacti Console Screen.
Cacti Console Screen
How to Create New Graphs
To create graphs, Click on New Graphs --> Select Host --> Select SNMP - Interface Statistics and Select a graph type In/Out Bits. Click on Create button. Please refer screen below.
Cacti Monitoring Graphs
For more information and usage please visit the Cacti Page.