Linux對(duì)外開(kāi)放端口
Linux對(duì)外開(kāi)放端口
Linux系統(tǒng)上經(jīng)常會(huì)出現(xiàn)一些現(xiàn)象就是,安裝好軟件訪問(wèn)的時(shí)候,服務(wù)器連接不上,這個(gè)時(shí)候就要檢查相應(yīng)的端口是否打開(kāi)了,接下來(lái)是小編為大家收集的Linux對(duì)外開(kāi)放端口,歡迎大家閱讀:
Linux對(duì)外開(kāi)放端口
svn服務(wù)啟動(dòng)了,在服務(wù)器上可以使用命令把文件檢出,但是其他電腦上就無(wú)法檢出,一直提示: "svn: Can't connect to host '*.*.*.*': 由于連接方在一段時(shí)間后沒(méi)有正確答復(fù)或連接" 在網(wǎng)上找了半天說(shuō)什么沒(méi)有啟動(dòng)服務(wù)什么的,廢話,沒(méi)起服務(wù)玩蛋呀。 我通過(guò)檢查防火墻看到3690端口根本沒(méi)有對(duì)外開(kāi)放,通過(guò)修改配置文件,解決問(wèn)題: 修改如下:
[root@nb home]# more /etc/sysconfig/iptables
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8009 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8081 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3690 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
[root@nb home]# /etc/init.d/iptables restart
iptables:清除防火墻規(guī)則: [確定]
iptables:將鏈設(shè)置為政策 ACCEPT:filter [確定]
iptables:正在卸載模塊: [確定]
iptables:應(yīng)用防火墻規(guī)則: [確定]
看了“Linux對(duì)外開(kāi)放端口”還想看: