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

转自https://blog.csdn.net/shuaigexiaobo/article/details/78190168

本文来自投稿,不代表Linux运维部落立场,如若转载,请注明出处:http://www.178linux.com/96670

(2)
小孜然小孜然
上一篇 2018-04-20 20:11
下一篇 2018-04-20 21:26

相关推荐

  • 配置ntp时间服务器,任务计划

    手动配置ntp时间服务 centos6 vim /etc/chrony.conf 加入service   172.20.0.1  iburst  保存 ntpdate 172.20.0.1 iburst systemctl enable chronyd 设为开机启动 centos6 chkconfig ntpd on设置开机开启ntp服务 vim  /etc…

    Linux笔记 2018-05-06
  • linux第二周

    总结

    Linux笔记 2018-04-08
  • 第五天作业

    shell 脚本编写[xhm@localhost ~]$ cat test.sh#!/bin/bash XXXXecho “welcome to beijing”ls -d /etc/[pP]*echo “hell -etss”ls -d /var/* | tr ‘a-z’ &#8216…

    Linux笔记 2018-05-27
  • yum配置

    本节简要介绍本地yum配置以及网络yum源的配置

    Linux笔记 2018-04-22
  • N31第二周作业

    本周(6.25–7.1)第2周 1、Linux上的文件管理类命令都有哪些,其常用的使用方法及其相关示例演示。 目录管理类命令:cd pwd ls mkdir rmdir tree cd:change directory cd [/PATH/TO/SOMEDIR] cd:切换回家目录 注意:bash中,~表示家目录 cd~:切换回自己的家目录 cd…

    Linux笔记 2018-07-02
  • 常用信息查询

    版本 发行版本 cat /etc/centos-releaseCentOS Linux release 7.4.1708 (Core) /*1708 17年8月发布*/ lsb_release -a /*显示上面文件内容*//*要安装工具*/ nano /etc/centos-release /*修改*//*生产中 尽量不要暴露版本号*/ 内核版本 name…

    Linux笔记 2018-04-08