Install Firewall on centos 7

First update your system to all latest packages by this command :

yum update -y

Now install firewall on your system :

yum install firewalld -y
systemctl status firewalld

Now start & enable firewall :

systemctl start firewalld
systemctl enable firewalld                           systemctl status firewalld

Now see how many zones in your system & who is your default zone :

firewall-cmd --get-zones
firewall-cmd --get-default-zone

Your default zone must be public if not then set default zone to public or your system may not work properly :

firewall-cmd --set-default-zone=public
firewall-cmd --get-default-zone

Now see the permanent list of all services & ports on your public zone :

firewall-cmd --permanent --zone=public --list-all

Thank you for reading this article.

Was this helpful?

1 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *