How to Start / Stop or Enable / Disable Firewall Service on Red Hat / CentOS and Debian / Ubuntu Linux

Followings are the steps to start/stop, enable/disable and check the status of Firewall Service on 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.
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 notFollowing 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
or
# 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.
Note: To execute below command, you might required root or sudo access.
# systemctl start firewalld.service
# systemctl stop firewalld.service
3. Check the current states of Firewall Service
Currently firewall service is active or running. press q to quit from console.
# systemctl status firewalld.service
or
# firewall-cmd --state
4. Enable / Disable Firewall Service
Followings are the command to enable/disable firewall service.
5. Following steps to disable Firewall Service permanently on RHEL/CentOS Linux
# systemctl stop firewalld.service
# systemctl disable firewalld.service
# systemctl mask --now firewalld.service
Note: Mask the firewall service will prevent firewall to start by other services.
On Debian / Ubuntu Linux
1. Check Status of Firewall Service
Following command to check status of firewall service.
$ sudo ufw status
2. Enable, Disable and Reload UFW Firewall Service
$ sudo ufw disable
$ sudo ufw enable
$ sudo ufw reload
Conclusion: In this tutorial, we have seen simple steps to start/stop and enable/disable Firewall Service in Linux. Big thanks for reading all the way to the end. Please share it with Your Friends & Help Someone... and also Like Our Facebook Page. Let me hear your thoughts in the comments below!
No comments:
Post a Comment
Please do not enter any spam link in the comment box.