CentOS 7 : Disable Firewalld and use iptables

As we all know that, CentOS both are completely systemd based, So We will have to use few systemd related commands to disable firewalld and enable iptables service.

  1. Disable Firewalld Service.
    systemctl mask firewalld
  2. Stop Firewalld Service.
    systemctl stop firewalld

  3. Install iptables service related packages.
    yum -y install iptables-services

  4. Make sure service starts at boot:
    systemctl enable iptables

    If you do not want ip6tables, You can skip following command.
    systemctl enable ip6tables

  5. Now, Finally Let’s start the iptables services.
    systemctl start iptables

    If you do not want ip6tables, You can skip following command.
    systemctl start ip6tables

Firewalld Service is now disabled and stop, You can use iptables.

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. You can configure firewall with iptables in same manner as previous.
 
 

(305)