Linux 6 View firewall status and open and close commands

Linux 6 view firewall status and open and close commands

https://blog.csdn.net/lv_shijun/article/details/52453882

There are two ways:

1. Service method

Check firewall status: 

[root@centos6 ~]# service iptables status

iptables: No firewall running.

Turn on the firewall:

[root@centos6 ~]# service iptables start

Turn off the firewall:

[root@centos6 ~]# service iptables stop

 

2. iptables method

First enter the init.d directory, the command is as follows:

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

[root@centos6 init.d]# 

Then

Check firewall status:

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

Temporarily turn off the firewall:

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

Restart iptables:

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

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325860466&siteId=291194637