Home / Linux  / Red Hat  / Disable Firewalld , Install and Configure Iptables on RHEL 7 / CentOS 7

Disable Firewalld , Install and Configure Iptables on RHEL 7 / CentOS 7

packet filtering. netfilter iptables firewalld



The most common network filtering programs is iptables. In latest Red Hat Enterprise and other linux based Operating system another is available named as Firewalld . Iptables  was the main method for network packet filtering program in earlier or old  Red Hat and CentOS versions.

In latest CentOs / both system based OS, so we will use system related command to enable,disable and stop firewall and iptables.


Disable Firewalld :


Here we are going to disable and stop default firewall firewalld .

# systemctl stop firewalld
# systemctl disable firewalld

In latest version of RHEL / CentOs, both iptables and firewalld can be available for use, then system may have conflict services installed . For prevention of an administrator from accidentally starting a service,  a service may be masked.Masking will prevent if the services is started , nothing will happen.

# systemctl mask firewalld


Install and Configure Iptables :


Here we are going to fresh install iptables service, may be in your server it already installed. Please check other wise install through below command.

# yum -y install iptables-services

Create Iptables files :

Run below command for create a blank or null files for iptables.

# touch /etc/sysconfig/iptables

If you use ip6tables services , then run the below command.

# touch /etc/sysconfig/ip6tables

To check and verify service will starts at boot :

# systemctl enable iptables

If you are using ip6tables, please run below command otherwise you can left or skip below command.

# systemctl enable ip6tables

Now lets start the iptables services.

# systemctl start iptables

For ip6tables services, use below command.

# systemctl start ip6tables

Now we have run the iptables services and stop and disable firewalld services.


A Linux Geek with Freelance Contributor, Server/ Cloud Administrator having 6+ Years experience in Open Source and Cloud Technologies.

Review overview
  • uwotm8 March 31, 2016

    So you swapped a scriptable iptables frontend for a static iptables script? fair enough.