Linux CentOS6.8下关闭防火墙

Igor Linux 网络安全评论12,202字数 1131阅读3分46秒阅读模式

一、临时关闭防火墙

1、 查看防火墙的状态

Linux CentOS6.8下关闭防火墙
  1. [root@vpnSS ~]# /etc/init.d/iptables status
  2. Table: filter
  3. Chain INPUT (policy ACCEPT)
  4. num target prot opt source destination
  5. 1 ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 state NEW udp dpt:8888
  6. 2 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:8888
  7. 3 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
  8. 4 ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0
  9. 5 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
  10. 6 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22
  11. 7 REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited
  12. 8 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:80
  13.  
  14. Chain FORWARD (policy ACCEPT)
  15. num target prot opt source destination
  16. 1 REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited
  17.  
  18. Chain OUTPUT (policy ACCEPT)
  19. num target prot opt source destination
  20. 1 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp spt:80
Linux CentOS6.8下关闭防火墙

2、 临时关闭防火墙

  1. [root@vpnSS ~]# /etc/init.d/iptables stop
  2. iptables: Setting chains to policy ACCEPT: filter [ OK ]
  3. iptables: Flushing firewall rules: [ OK ]
  4. iptables: Unloading modules: [ OK ]

3、 查看关闭后的状态

  1. [root@vpnSS ~]# /etc/init.d/iptables status
  2. iptables: Firewall is not running.

二、永久关闭防火墙

命令:chkconfig --level 2345 iptables off
或者 chkconfig iptables off  #on开启防火墙 
其中2345 代表”执行等级“
等级0表示:表示关机
等级1表示:单用户模式
等级2表示:无网络连接的多用户命令行模式
等级3表示:有网络连接的多用户命令行模式
等级4表示:不可用
等级5表示:带图形界面的多用户模式
等级6表示:重新启动

文章末尾固定信息

weinxin
我的微信
我的微信
一个码农、工程狮、集能量和智慧于一身的、DIY高手、小伙伴er很多的、80后奶爸。
 
Igor
  • 本文由 Igor 发表于 2019-12-2315:43:44
centos下设置nodejs开机启动 NodeJS

centos下设置nodejs开机启动

node环境的安装便不再赘述了,网上有很多教程,也非常简单。 上一篇博客介绍了用nginx代理nodejs。这一篇是使用pm2实现nodejs的自动重启。 什么是pm2? 如官网介绍的,pm2是nod...
匿名

发表评论

匿名网友
:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:
确定

拖动滑块以完成验证
加载失败