October 18, 2025
Security Tutorials

Disable Firewall on CentOS 10: Quick and Safe Method

Disable Firewall on CentOS 10

CentOS 10 includes a firewall management tool called firewalld. This tool provides network security through the control of incoming and outgoing traffic. CentOS’s firewalld service makes it easy to manage network security on Linux servers. You may need to disable your firewall in some situations, such as when troubleshooting a network issue, installing a web app, or testing connectivity.

This guide will teach you how to disable the CentOS firewall using temporary and permanent methods safely.

Table of Contents

How to Disable Firewall on CentOS 10

Although it is not recommended that you disable the firewall in production servers, it may be necessary to do so temporarily, for example, during troubleshooting or testing network services. This step-by-step tutorial will show you how to disable the firewall and keep your system safe on CentOS 10.

Step 1: Check the Current Firewall Status

It’s important to check the current status of your firewall before disabling it. Run the following command.

sudo systemctl status firewalld

  sudo systemctl status firewalld

This command will show whether the firewalld service has been enabled, inactive, or active. You’ll notice a green “active”, which means the firewall is currently enforcing its rules on your computer.

Step 2: Stop the Firewall Service Temporarily

Use the following to disable the firewall temporarily (until your next reboot).

sudo systemctl stop firewalld

  sudo systemctl stop firewalld

This command will stop the firewalld service instantly, but won’t prevent it from starting up again when the system is rebooted.

This is a good option if you need to quickly test something without any firewall restrictions.

To confirm that it stopped successfully, run:

sudo systemctl status firewalld

  sudo systemctl status firewalld

The output should now show “inactive” (dead).

Step 3: Disable the Firewall Permanently

If you want to turn off the firewall permanently, preventing it from starting automatically on boot, use:

sudo systemctl disable firewalld

  sudo systemctl disable firewalld

This command prevents firewalld from automatically starting when the system boots. The firewall service will not be enabled until you manually enable the service again.

To verify that it has been disabled, you can run:

sudo systemctl is-enabled firewalld

  sudo systemctl is-enabled firewalld

The firewall will not start if it is disabled.

Step 4: Mask the Firewall Service (Optional)

You can mask the firewall service to prevent it from being started automatically or manually.

sudo systemctl mask firewalld

  sudo systemctl mask firewalld

The service is effectively blocked from being started by masking the file. This is a more effective measure than disabling the firewall; it will not work even if a different process tries to do so.

If you ever want to unmask it again, use:

sudo systemctl unmask firewalld

  sudo systemctl unmask firewalld

Step 5: Verify the Firewall is Disabled

Double-check the status of your firewall after stopping and disabling it:

sudo firewall-cmd –state

  sudo firewall-cmd --state

If you see “not running”, this means that firewalld has been completely disabled on CentOS.

You can also check with:

sudo systemctl status firewalld

  sudo systemctl status firewalld

The firewall should be inactive if both commands are executed.

Step 6: (Optional) Remove the firewalld Package

You can remove it entirely if you do not plan to use the firewall at all.

sudo yum remove firewalld

  sudo yum remove firewalld

The firewall management tool will be permanently removed from your computer. Only do this in isolated environments for testing or development.

Important Security Note

If you disable the firewall, your CentOS system is not protected from unauthorized intrusion.

For example, configure specific firewall rules rather than disable it completely. You can safely manage exceptions by allowing specific ports without disabling your firewall.

sudo firewall-cmd –permanent –add-port=22/tcp

  sudo firewall-cmd --permanent --add-port=22/tcp

It’s recommended that you use other security measures if your server is accessible via the internet. Let’s reload services:

sudo firewall-cmd –reload

  sudo firewall-cmd --reload

This will allow SSH access to the firewall while the rest is active.

Conclusion

You can disable the CentOS 10 firewall for debugging or to run specific applications that require open access. You can disable it permanently by using systemctl enable firewalld, or stop it temporarily. Remember that your firewall is an important layer of security for your server. Re-enable or configure the proper rules after you finish testing. These steps will help you manage the CentOS 10 firewall according to your system’s requirements.

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video