linkxu1989

CentOS关闭防火墙

2017-06-08 12:51  linkxu  阅读(265)  评论(0编辑  收藏  举报

CentOS 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 #设置防火墙开机启动

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

分类:

技术点:

相关文章:

  • 2021-08-06
  • 2021-10-06
  • 2021-10-19
  • 2021-11-30
  • 2022-02-01
猜你喜欢
  • 2021-04-11
  • 2021-07-15
  • 2021-12-12
  • 2022-01-05
  • 2021-12-21
  • 2022-03-07
相关资源
相似解决方案