zoukankan      html  css  js  c++  java
  • Linux学习笔记之CentOS6.9 防火墙的关闭以及开启

    有的时候,我们需要对系统的防火墙进行操作,今天小编就给大家讲解一下如何开启以及关闭CentOS6.9系统下的防火墙。

    输入:cat /etc/issue   查看版本

    (一)通过service命令

    service命令开启以及关闭防火墙为即时生效,下次重启机器的时候会自动复原。

    查看防火墙状态:service iptables status  ,记得在CentOS6.9中是输入iptables,网上有些教程使用service iptable status 命令并不可行。

    关闭防火墙:service iptables stop

     

    打开防火墙:service iptables start

     

    总结:

    打开防火墙:service iptables start

    关闭防火墙:service iptables stop

    查看防火墙状态:service iptables status

    (二)通过:/etc/init.d/iptables 进行操作

    查看防火墙状态:/etc/init.d/iptables/status

     

    关闭防火墙:/etc/init.d/iptables stop(这是临时关闭,关闭的是当前运行的防火墙,重启之后防火墙又会启动,因为它是开机自启动的)

     

    这是临时关闭,关闭的是当前运行的防火墙,重启之后防火墙又会启动,因为它是开机自启动的,它相当于/etc/init.d/iptables start。

    (三)需要改为开机不启动,使用chkconfig命令

    永久开启防火墙: chkconfig iptables on

    查看状态:chkconfig --list iptables

     

    永久关闭防火墙:

     chkconfig iptables off

    参考

  • 相关阅读:
    hdu5784 极角排序+two point
    极角排序理解
    计算多边形的面积模板
    18年CUG校赛--恶魔的序列
    二分图匹配模板
    POJ 2342 Anniversary party
    蓝桥杯真题-小计算器
    第八届蓝桥杯省赛真题题解
    Django具体操作(四)
    网络爬虫(三)
  • 原文地址:https://www.cnblogs.com/JetpropelledSnake/p/9296445.html
Copyright © 2011-2022 走看看