centos7 防火牆 錯誤 (坑)
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 的 問題,其實還是沒有解決,只是想辦法避開了這個問題,如果解決不了的話,還是考慮降版本。。。。