How to Enable/Disable the Firewall on Rocky Linux 9


A firewall is an quintessential service for server and system safety. A predetermined set of guidelines controls and filters the community site visitors passing to Linux servers. A firewall blocks all exterior site visitors apart from in the event that they have any suspicious troubles.

Firewalld is a light-weight and favourite command-line Treatment resolution for Linux servers. It manages the community site visitors utilizing the idea of zones. You can assign the community interfaces to zones utilizing the predefined guidelines. You can configure the firewall to dam and enable the companies or ports related to the applying.

Permanently or quickly enabling or disabling the firewalld is without doubt one of the quintessential associated duties to troubleshoot the server entry. This guideline sees how one can allow/disable the firewall on Rocky Linux 9.

How to Enable/Disable the Firewall on Rocky Linux 9

RHEL-based distros like Fedora, Rocky Linux, CentOS, and AlmaLinux have an set up firewalld by default. First, use the subsequent command to investigate the firewalld’s standing:

sudo systemctl standing firewalld

You can even use any of the subsequent instructions to investigate the standing of the firewalld:

sudo firewall-cmd –state
sudo systemctl is-active firewalld
sudo systemctl is-active firewalld.service
sudo systemctl standing firewalld.service

Disable the Firewall on Rocky Linux 9

You can give up the firewalld service on the Rocky Linux server utilizing any of the subsequent instructions:

sudo systemctl give up firewalld.service
sudo service firewalld give up
sudo systemctl give up firewalld

After stopping the firewalld service, you will notice that its companies develop into inactive within the standing tips:

Once you disable the firewall, you need to manually allow or restart the system.

In some situations, the safety communities deal with the firewall. In this case, a firewall seriously is not required on a bunch. Hence, you can actually completely disable the firewalld service with the aid of the subsequent command:

sudo systemctl disable firewalld

If you don’t desire to go for a number of steps to give up and disable the firewalld service, you can actually additionally use a single command solely:

systemctl disable firewalld –now

The earlier command makes use of the –now argument with the systemctl disable command to use the variations to the runtime ecosystem.

To ward off the firewalld companies from the firewalld-bus interface or every other service from operating, you can actually masks its companies with the subsequent command:

sudo systemctl masks firewalld

Now, your Firewall Daemon service is masked; you can’t allow it except its companies are unmasked. Masking the firewalld companies signifies that no different service or procedure has the privilege to allow your firewall. Let’s investigate the standing of the firewall:

sudo systemctl is-active firewalld

Enable the Firewall on Rocky Linux 9

Since we masked the firewalld service within the earlier manner, it can not start off routinely after restarting the system. Now, unmask the service first with the aid of the subsequent command:

sudo systemctl unmask firewalld

After unmasking the service, start off the firewalld service utilizing any of the subsequent instructions:

sudo service firewalld start off
sudo systemctl start off firewalld

If you desire to investigate the standing of the at the moment operating firewall service, run the subsequent command:

sudo systemctl start off firewalld

You can allow the firewall service completely with the aid of the subsequent command:

sudo systemctl allow firewalld

Similarly, you can actually run the one command to allow the firewalld service:

sudo systemctl allow firewalld –now

Skip the systemctl start off firewall step. You can allow it by commencing the firewalld service as quickly as achievable with the –now flag.

Finally, you can actually investigate the standing to see that the firewalld service is enabled.

sudo systemctl standing firewalld


This is all about enabling and disabling the firewalld on Rocky Linux 9. The firewall protects your machine and system from undesirable exterior site visitors. It allows you to outline the principles to regulate and shelter the incoming community site visitors. You can block, deny, or enable the site visitors by disabling the firewall in your system.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More