This article covers how to disable FirewallD and install and iptables on CentOS 7 server. The iptables service stores configuration in /etc/sysconfig/iptables and /etc/sysconfig/ip6tables , while firewalld stores it in various XML files in /usr/lib/firewalld/ and /etc/firewalld/ .
Note that the /etc/sysconfig/iptables file does not exist as firewalld is installed by default on Red Hat Enterprise Linux.
FirewallD is a complete firewall solution that can be controlled with a command-line utility called firewall-cmd. If you are more comfortable with the Iptables command line syntax, then you can disable FirewallD and go back to the classic iptables setup.
To Install and Use Iptables Linux Firewall:
1. Connect to your server via SSH.
2. Execute the following command one by one:
$ sudo apt-get update
$ sudo apt-get install iptables
3. Check the status of your current iptables configuration by running:
$ sudo iptables -L -v
Location of iptables rules on CentOS ?
CentOS 7 uses FirewallD by default. If you would like to manage iptables/ip6tables rules directly without using FirewallD, you may use the old good iptables-services service which will load the iptables/ip6tables rules saved in /etc/sysconfig/iptables and /etc/sysconfig/ip6tables when it is started during boot time.