Using IPTables on CentOS 7

Replace FirewallD with IPTables on CentOS 7

FirewallD has replaced IPTables as the default firewall in CentOS 7. You can disable it and install iptables if you prefer.

Stop and Disable FirewallD

First we want to stop firewalld, and disable the service at startup.

systemctl stop firewalld && systemctl mask firewalld

Install and Enable IPTables

Now we want to install iptables, set it to start at boot, and start the service.

yum -y install iptables-services
systemctl enable iptables

# optional for ipv6 compatability
systemctl enable ip6tables

# Start IPTables
systemctl start iptables

#optional for ipv6 compatability
systemctl start ip6tables 
Current rating: 4.1