您的位置:首页 > 运维架构 > Linux

centos7 防火墙 错误 (坑)

2016-03-30 19:17 477 查看
centos7中 防火墙以及端口号的 启动。

1、centos7中 取消了iptables ,只能使用firewall。

2、安装tomcat 后,并启动tomcat,发现访问不通,检查tomcat配置文件,端口号没错是8080,

确认端口号是否启用,telnet 182.169.*.*(虚拟机ip) 8080, 无法使用,

使用 firewall-cmd --query-port=8081 确认8080 是否开启

结果:bad port (most likely missing protocol), correct syntax is portid[-portid]/protocol

!!! 这是什么鬼,端口坏掉了吗!!!

百度也没有找到找到有人碰到我这种情况,谷歌到是有人提出过这个问题,但是也只是提交BUG的页面,没有给出解决的方案。
https://bugzilla.redhat.com/show_bug.cgi?id=1274961(翻墙。。)
在我都打算重装系统,回退到centos6的时候,想到是不是可以关闭掉防火墙,禁用firewall,而改用iptables呢?

感谢:http://www.linuxidc.com/Linux/2015-03/114749.htm

安装iptables-services,然后禁用firewalld。

yum install -y iptables-services

安装iptables-services

systemctl mask firewalld

禁用firewalld

systemctl enable iptables

systemctl enable ip6tables

启动iptables

systemctl stop firewalld

暂停firewalld

systemctl start iptables

systemctl start ip6tables

开启iptables

到现在开始,我们就可以配置iptables规则。

然后访问重新启动telnet 8080 端口,终于能访问通了,启动tomcat,终于看到那只猫了。。。。

关于 bad prot 的 问题,其实还是没有解决,只是想办法避开了这个问题,如果解决不了的话,还是考虑降版本。。。。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: