Logo

How To Install FirewallD on CentOS 7

Mar 30, 2024

To install FirewallD on CentOS 7, follow the steps below.

Step 1 : Update your system:

sudo yum update

Step 2 : If FirewallD is not already installed, install it:

sudo yum install firewalld

Step 3 : Start the FirewallD service:

sudo systemctl start firewalld

Step 4 : Enable FirewallD to start on boot:

sudo systemctl enable firewalld

Step 5 : Check the status of FirewallD:

sudo systemctl status firewalld

Step 6 : Basic FirewallD Configuration (e.g., allowing ports 80 and 443):

sudo firewall-cmd --zone=public --add-port=80/tcp --permanent
sudo firewall-cmd --zone=public --add-port=443/tcp --permanent
sudo firewall-cmd --reload

Congratulations! You have successfully installed and configured FirewallD on CentOS 7.