Firewalld is a firewall management tool that is utilized to manage the firewall on Linux systems. It provides a dynamic firewall that can be updated without requiring a restart. Furthermore, it allows users to control the network traffic and secure the system effectively.
This guide will demonstrate how to start, stop, enable, and disable Firewalld in Linux.
- Install Firewalld Package
- Start Firewalld
- Stop Firewalld
- Enable Firewalld
- Disable Firewalld
Prerequisite: Install Firewalld Package
It is necessary to install the firewalld package to start/stop or enable/disable the firewalld in Linux. To install the firewalld package, execute the below commands:
$ sudo apt install firewalld # Ubuntu, Debian, and LinuxMint
$ sudo yum install firewalld # CentOS/Debian
$ sudo pacman -S firewalld # Arch / Manjaro
The output shows that the firewalld package has been installed along with dependencies.
How to Start Firewalld?
To start Firewalld, use the systemctl command with the “start” utility by specifying the “firewalld” package:
$ sudo systemctl start firewalld.service
This command starts the Firewalld service on the Linux system.
Check the Status of Firewalld
To check the status of firewalld, run the “systemctl” command with the “status” utility as below:
$ sudo systemctl status firewalld.service
The output shows that firewalld services are in an active state.
How to Stop Firewalld?
To stop Firewalld, users can use the “systemctl” command with the “stop” utility by mentioning the “firewalld.service”:
$ sudo systemctl stop firewalld.service
$ sudo systemctl status firewalld.service
This command stops the Firewalld service on the Linux system that can be verified through the “dead” state.
How to Enable Firewalld?
To enable Firewalld, utilize the “systemctl” command with the addition of the “enable” utility. When the Firewalld service is enabled, it automatically sets up a firewall using predefined default rules. This helps to protect the system and its network services from unauthorized access and potential attacks:
$ sudo systemctl enable firewalld.service
$ sudo systemctl status firewalld.service
It enables the Firewalld service that can be verified through the “active” state.
Note: The services automatically start when the operating system boots up.
How to Disable Firewalld?
To disable Firewalld, use the “disable” utility by specifying the “firewalld” command:
$ sudo systemctl disable firewalld.service
This command disables the Firewalld service from starting automatically when the system boots up.
Conclusion
To start/stop or enable/disable the firewalld services, use the “sudo systemctl <utility_name> firewalld.service” command. Before it, it is required that the firewalld package is installed in the operating system. To check the services of firewalld, execute the “sudo systemctl status firewalld.service” command.
This guide has explained how to start/stop/enable/disable the firewalld services in Linux.