码迷,mamicode.com
首页 > 其他好文 > 详细

Centos关闭防火墙

时间:2018-06-20 00:49:38      阅读:183      评论:0      收藏:0      [点我收藏+]

标签:config   .com   本机   虚拟机   conf   永久   必须   防火墙   lin   

有时候,在虚拟机(我用的是centos)上面开了服务,在外面访问不到,本机一切都正常,这时就应该想到防火墙。

关闭防火墙:

首先,我们要知道要关闭的可能还不少,有iptables,firewalld,selinux,下面一个个来关闭;

a1、查看状态:systemctl status firewalld

技术分享图片

a2、关闭: systemctl stop firewalld(事实证明,只执行这个,重启之后是不行的,还必须执行systemclt disable firewalld)

技术分享图片

b1、查看selinux状态:getenforce

技术分享图片

b2、关闭:编辑文件 /etc/selinux/config,将selinux的值改成disable,然后重启生效(reboot)

技术分享图片

c1、查看iptables状态:systemctl status iptables

技术分享图片

 

c2、centos7 默认是使用firewalld作为防火墙,iptables是关闭状态,,若要关闭执行命令chkconfig iptables off(永久关闭)

Centos关闭防火墙

标签:config   .com   本机   虚拟机   conf   永久   必须   防火墙   lin   

原文地址:https://www.cnblogs.com/qstudy/p/Linux.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!