CentOS 7.0关闭防火墙

7.0默认使用的是firewall作为防火墙,使用iptables必须重新设置一下

1、直接关闭防火墙

systemctl stop firewalld.service #停止firewall

systemctl disable firewalld.service #禁止firewall开机启动

2、设置 iptables service

yum -y install iptables-services

如果要修改防火墙配置,如增加防火墙端口3306

vi /etc/sysconfig/iptables

增加规则

-A INPUT -m state –state NEW -m tcp -p tcp –dport 3306 -j ACCEPT

保存退出后

systemctl restart iptables.service #重启防火墙使配置生效

systemctl enable iptables.service #设置防火墙开机启动

最后重启系统使设置生效即可。

更多iptables相关教程见以下内容

7.0关闭默认防火墙启用iptables防火墙 

iptables使用范例详解

防火墙iptables详细教程

iptables的备份、恢复及防火墙脚本的基本使用

下防火墙iptables用法规则详解

下iptables防火墙设置

转载自:https://www.linuxidc.com/Linux/2016-03/129425.htm

声明: 除非转自他站(如有侵权,请联系处理)外,本文采用 BY-NC-SA 协议进行授权 | 智乐兔
转载请注明:转自《CentOS 7.0关闭防火墙
本文地址:https://www.zhiletu.com/archives-6294.html
关注公众号:智乐兔

赞赏

wechat pay微信赞赏alipay pay支付宝赞赏

上一篇
下一篇

相关文章

在线留言

你必须 登录后 才能留言!

在线客服
在线客服 X

售前: 点击这里给我发消息
售后: 点击这里给我发消息

智乐兔官微