OS/Linux

RHEL 7 / CentOS 7 : Disable Firewalld and use iptables

Temporary backups 2021. 5. 14. 06:40
반응형

As we all know that, CentOS / RHEL 7 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.

[root@localhost ~]# systemctl disable firewalld



2. Stop Firewalld Service.

[root@localhost ~]# systemctl stop firewalld



3. Install iptables service related packages.

[root@localhost ~]# yum -y install iptables-services



4. Make sure service starts at boot:

[root@localhost ~]# systemctl enable iptables
# If you do not want ip6tables, You can skip following command.

[root@localhost ~]# systemctl enable ip6tables



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

[root@localhost ~]# systemctl start iptables
# If you do not want ip6tables, You can skip following command.

[root@localhost ~]# 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.

반응형