Linux操作-关闭防火墙

Linux操作-关闭防火墙

正常情况下,为了安全起见,防火墙是不能关闭的。但是在测试或者实验的环境下,关掉它比较方便测试。

1 查看防火墙状态

操作指令如下:

[root@Nginx01 lichengpeng]# service iptables status

防火墙开启的时候显示:


01-开启的防火墙.png

防火墙关闭的时候显示:


02-关闭的防火墙.png

2 关闭防火墙

2.1 临时关闭

使用下面的这种方式关闭,重启系统后,防火墙还是会自动开启。

[root@Nginx01 lichengpeng]# service iptables stop
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Unloading modules:                               [  OK  ]

2.2 长期关闭

如果想长期关闭防火墙,那么就需要下面的指令去操作:

[root@Nginx01 lichengpeng]# chkconfig iptables off
[root@Nginx01 lichengpeng]# service iptables stop

查看Linux七种开机模式下防火墙的启动状态:

[root@Nginx01 lichengpeng]# chkconfig iptables --list
iptables        0:off   1:off   2:off   3:off   4:off   5:off   6:off
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容