centos7防火牆致使不能訪問的

CentOS 7.0默認使用的是firewall做爲防火牆,使用iptables必須從新設置一下tcp

一、直接關閉防火牆rest

systemctl stop firewalld.service #中止firewallip

systemctl disable firewalld.service #禁止firewall開機啓動table

二、設置 iptables service配置

yum -y install iptables-servicesiptables

若是要修改防火牆配置,如增長防火牆端口3306service

vi /etc/sysconfig/iptables 防火牆

增長規則yum

-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPTtop

保存退出後

systemctl restart iptables.service #重啓防火牆使配置生效

systemctl enable iptables.service #設置防火牆開機啓動

最後重啓系統使設置生效便可。

相關文章
相關標籤/搜索