linux Instance method to see if firewall is closed

  • 2021-07-26 09:11:46
  • OfStack

1. service mode

View firewall status:

[root@centos6 ~]# service iptables status

iptables: Firewall not running.

Recommended tutorial: linux tutorial

2. iptables mode

Go to the init. d directory first, and the command is as follows:

[root@centos6 ~]# cd /etc/init.d/

[root@centos6 init.d]#

Then check the firewall status:

[root@centos6 init.d]# /etc/init.d/iptables status

Content extension:

The firewall configuration of CentOS7 is quite different from the previous version. The firewall of CentOS7 uses firewall by default, which is different from the previous version using iptables

1. Close the firewall:

systemctl stop firewalld.service

2. Turn on the firewall:

systemctl start firewalld.service

3. Turn off the boot and start:

systemctl disable firewalld.service

4. Start the startup:

systemctl enable firewalld.service


Related articles: