Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable firewall on Centos 7?

My firewall is currently inactive.

# systemctl status firewalld
firewalld.service
    Loaded: masked (/dev/null)
    Active: inactive (dead)

I used the following command to enable the firewall

$systemctl unmask firewalld

but I got this error

# systemctl unmask firewalld
Failed to issue method call: Access denied

Please advise.

Thanks in advance!

like image 372
MahuLovzYou Avatar asked Apr 17 '15 21:04

MahuLovzYou


2 Answers

Try this:

systemctl unmask firewalld

return: Removed symlink /etc/systemd/system/firewalld.service.

After that, you can:

systemctl restart firewalld
like image 134
Santos L. Victor Avatar answered Sep 29 '22 08:09

Santos L. Victor


Try this:

sudo systemctl restart firewalld
sudo systemctl enable firewalld

But before you should install firewalld. You can use yum for that:

sudo yum install firewalld
like image 32
gomons Avatar answered Sep 29 '22 09:09

gomons