How to enable Iptables firewall in CentOS 7 / RHEL 7

After fresh Installation of CentOS 7, I was trying to open some ports using iptables as usual in CentOS 5 or CentOS 6. Something was wrong with iptables service. Ok.. Let’s see why its not available and how to enable iptables firewall in CentOS 7 / RHEL 7.

Enable iptables firewall in centos 7
Enable iptables firewall in CentOS 7

Asnwer:With the relase of CentOS 7 / RHEL 7, firewalled was introduced to manage iptables. But fortunately it is possible to go back a more classic iptables setup:


Enable Iptables firewall in CentOS 7 / RHEL 7

1. Stop Firewalld Service

# systemctl stop firewalld

2. Disable Firewalld Service

# systemctl mask firewalld

3. Use following command to Install iptables-service package

# yum -y install iptables-services

4. Enable the service at startup

# systemctl enable iptables

5. Start iptables service

# systemctl start iptables

Now iptables are available as your firewall, you can remove / add rules as you were doing in older releases of CentOS /RHEL 5 and 6. Enjoy :). Do not forget to say thanks if it works for you.

Similar Posts