This is a short HOWTO replace or disable firewalld with iptables in CentOS 7. As we all know that, CentOS / RHEL 7 both are completely systemd based, So We will have to use few systemd related commands to disable firewalld and enable iptables service.
Disable and stop the Firewalld service:
# systemctl mask firewalld
# systemctl stop firewalld
Install iptables service related packages.
# yum -y install iptables-services
Activate the iptables and ip6tables services at boot:
# systemctl enable iptables ip6tables
Go to the /etc/sysconfig directory and define your rules in the iptables and ip6tables config files.
Start the iptables and ip6tables service:
# systemctl start iptables ip6tables
Now, You will be able to use iptables as your firewall. You can add / remove rules as you were doing in previous releases of Red Hat / CentOS 5 and 6 and you can configure firewall with iptables in same manner as previous.