To use the iptables and ip6tables services instead of firewalld, first disable firewalld by running the following command as root:
root# systemctl disable firewalld
root# systemctl stop firewalld
Then install the iptables-services package by entering the following command as root:
root# yum install iptables-services
The iptables-services package contains the iptables service and the ip6tables service.
Then, to start the iptables and ip6tables services, run the following commands as root:
root# systemctl start iptables
root# systemctl start ip6tables
root# systemctl enable iptables
root# systemctl enable ip6tables
An example script which blocks INPUT and FORWARD and runs /sbin/iptables-save and writes the current iptables configuration to /etc/sysconfig/iptables. Upon reboot, the iptables init script reapplies the rules saved in /etc/sysconfig/iptables by using the /sbin/iptables-restore command.
Continue reading “Use the iptables and ip6tables services instead of firewalld – CentOS 7”