CentOS 配置防火墙操作实例(启、停、开、闭端口):

CentOS 配置防火墙操作实例(启、停、开、闭端口):

注:防火墙的基本操作命令:

查询防火墙状态:

[root@localhost ~]# service   iptables status<回车>

 

停止防火墙:

[root@localhost ~]# service   iptables stop <回车>

 

启动防火墙:

[root@localhost ~]# service   iptables start <回车>

 

重启防火墙:

[root@localhost ~]# service   iptables restart <回车>

 

永久关闭防火墙:

[root@localhost ~]# chkconfig   iptables off<回车>

 

永久关闭后启用:

[root@localhost ~]# chkconfig   iptables on<回车>

编辑防火墙

用编辑器打开/etc/sysconfig/iptables 

原文地址:https://www.cnblogs.com/hellozg/p/6222166.html