centos7 permanently turn off the firewall

First enter the user name and password to enter centos7.

Then first look at the status of centos7 firewall, the command to view is

sudo systemctl status firewalld。

After checking, seeing active (running) means that the firewall is turned on.

How to check, open and close the firewall in centos7

If you want to turn off the firewall, the command is:

sudo systemctl stop firewalld。

After closing, check whether the shutdown is successful. If you see inactive (dead), it means that the firewall is closed.

How to check, open and close the firewall in centos7

The command to open the firewall is:

sudo systemctl start firewalld。

How to check, open and close the firewall in centos7

The above opening and closing of the firewall are temporary. After restarting the computer, it will return to the default state (my default state is on). As shown in the figure, I first closed the firewall, and then typed reboot to restart centos7.

How to check, open and close the firewall in centos7

Check the firewall status after restarting, and it is still open.

How to check, open and close the firewall in centos7

If you want the firewall to be closed after restarting, you have to use the command:

sudo systemctl disable firewalld。

How to check, open and close the firewall in centos7

After entering the command in the previous step, turn off the firewall and restart it.

How to check, open and close the firewall in centos7

After restarting, check the firewall status again, the firewall is now closed.

How to check, open and close the firewall in centos7
The command to check the status of the firewall is: sudo systemctl status firewalld.

There are two ways to turn on the firewall, one is to restart it after turning it on, the command will be: sudo systemctl start firewalld; the other is that it will not return to the original state after turning it on, the command is: sudo systemctl enable firewalld, after entering the command in this way, the system will not take effect until you restart the system.

There are also two ways to turn off the firewall, corresponding to opening, the commands are respectively

sudo systemctl stop firewalld

sudo systemctl disable firewalld。

Guess you like

Origin blog.csdn.net/nbcsdn/article/details/100567497