Why should you disable firewall service in Linux? Normally in production environment hardware-based firewall should be placed to protect outside access or to filter packets to and fro into the servers. In this case, you might not required to enable firewall service on each server. Still you want to start/stop and enable/disable firewall service in .RPM Based (CentOS, RHEL etc.) or .DEB based (Debian & Ubuntu etc.) Linux. Firewalld is the daemon which is installed by default in CentOS/RHEL 8 Linux. On Red Hat Linux 8 nftables is the default network packet filtering which has replaced earlier iptables framework. FirewallD is a dynamic daemon to manage firewall with support for networks zones. FirewallD package is installed by default in RHEL/CentOS Linux 7 onward. UFW or Uncomplicated Firewall is installed on Debian or Ubuntu Linux by default. In this article, we will explain how to start/stop and enable/disable firewall service in CentOS/RHEL and Debian/Ubuntu Linux.
Note: We recommend you to enable software-based firewall even if you have a hardware-based firewall is installed in your environment. This would provide the second layer of security for individual servers.
On Red Hat / CentOS Linux
1. Check whether Firewall Service is running or not
Following command to check status of firewall service in your system. Currently firewall service is inactive or dead. press q to quit from console.
# systemctl status firewalld.service
# firewall-cmd –state
2. Start / Stop Firewall Service
If you are using CentOS/RHEL or Fedora Linux, below is the command to start/stop firewall service.
5. Following steps to disable Firewall Service permanently on RHEL/CentOS Linux
On Debian / Ubuntu Linux