first check status of firewalld
status by below command :
sudo systemctl status firewalld
if you get output Active: active
so run the following command :
sudo systemctl enable firewalld
but if you get output Active: inactive (dead)
or Loaded: masked (/dev/null; bad)
follow the below commands :
sudo systemctl unmask --now firewalld
the output should indicate that the symlink has been removed
.
then run the below command :
sudo systemctl enable firewalld
after enabling the firewall, start the firewalld
service:
sudo systemctl start firewalld
when the system executes the command, there is no output. Therefore, it is wise to verify whether the firewall has been activated successfully.
check firewall status with:
sudo systemctl status firewalld
if you see the Active: active (running)
message you can now do what you wanted to do.