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
![](https://linuxmining.com/wp-content/uploads/2020/10/firewall-status-inactive.png)
Now start & enable firewall :
systemctl start firewalld
systemctl enable firewalld systemctl status firewalld
![](https://linuxmining.com/wp-content/uploads/2020/10/firewall-cmd-active-1024x232.png)
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
![](https://linuxmining.com/wp-content/uploads/2020/10/firewall-list.png)
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