Welcome 微信登录

首页 / 操作系统 / Linux / CentOS 7.0关闭防火墙

CentOS 7.0默认使用的是firewall作为防火墙,使用iptables必须重新设置一下1、直接关闭防火墙systemctl stop firewalld.service #停止firewallsystemctl disable firewalld.service #禁止firewall开机启动2、设置 iptables serviceyum -y install iptables-services如果要修改防火墙配置,如增加防火墙端口3306vi /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相关教程见以下内容:CentOS 7.0关闭默认防火墙启用iptables防火墙  http://www.linuxidc.com/Linux/2015-05/117473.htmiptables使用范例详解 http://www.linuxidc.com/Linux/2014-03/99159.htmLinux防火墙iptables详细教程 http://www.linuxidc.com/Linux/2013-07/87045.htmiptables的备份、恢复及防火墙脚本的基本使用 http://www.linuxidc.com/Linux/2013-08/88535.htmLinux下防火墙iptables用法规则详解 http://www.linuxidc.com/Linux/2012-08/67952.htmLinux下iptables防火墙设置 http://www.linuxidc.com/Linux/2015-10/123843.htm本文永久更新链接地址