大家好我是小华,centos7查看防火墙,关于centos7查看防火墙规则很多人还不知道,那么现在让我们一起来看看吧!

1、你好,从《linux就该这么学》的教材得知 CentOS 7系列默认采用firewall作为系统防火墙,既然你已经问iptables怎么关闭了,默认的就是您已经停用firewall且安装好iptables了,有关关闭iptables的命令开关的命令有以下几个:查询防火墙状态:[root@localhost ~]# serv iptables status停止防火墙:[root@localhost ~]# serv iptables stop启动防火墙:[root@localhost ~]# serv iptables start重启防火墙:[root@localhost ~]# serv iptables restart关闭防火墙:[root@localhost ~]# chkconfig iptables off关闭后启用:[root@localhost ~]# chkconfig iptables on希望能够帮助你!并且你看看《Linux 就该这么学》,是以rhel7作为教学的系统来编写的教材,一直在更新,同时百度搜索以后 打开每天都有很多linux技巧,咨讯,以及技术干货!1、关闭firewall:ctl stop firewalld.serv #停止firewallctl disable firewalld.serv #禁止firewall开机启动firewall-cmd --state #查看默认防火墙状态(关闭后显示notrunning,开启后显示running)2、iptables防火墙(这里iptables已经安装,下面进行配置)vi/etc/sysconfig/iptables #编辑防火墙配置文件# sampleconfiguration for iptables serv# you can edit thianually or use -config-firewall# please do not askus to add additional ports/servs to this default configurationfilter:INPUT ACCEPT [0:0]:FORWARD ACCEPT[0:0]:OUTPUT ACCEPT[0:0]-A INPUT -m state--state RELATED,ESTABLISHED -j ACCEPT-A INPUT -p icmp -jACCEPT-A INPUT -i lo -jACCEPT-A INPUT -p tcp -mstate --state NEW -m tcp --dport 22 -j ACCEPT-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -jACCEPT-A INPUT -p tcp -m state --state NEW -m tcp --dport 8080-j ACCEPT-A INPUT -j REJECT--reject-with icmp-host-prohibited-A FORWARD -jREJECT --reject-with icmp-host-prohibitedCOMMIT:wq! #保存退出由来征战地,不见有人还。

本文到这结束,希望上面文章对大家有所帮助。