美文网首页Linux
Linux操作-关闭防火墙

Linux操作-关闭防火墙

作者: 李程鹏 | 来源:发表于2017-10-07 22:25 被阅读0次

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

相关文章

网友评论

    本文标题:Linux操作-关闭防火墙

    本文链接:https://www.haomeiwen.com/subject/gzusyxtx.html