2012-01-30 98 views
0

我在努力瞭解爲什麼我無法通過添加IPTABLES規則來打開端口61616。以下是通過IPTABLES -L命令獲取的所有規則的列表。無法在IPTABLES防火牆上打開端口

Chain INPUT (policy ACCEPT) 
target  prot opt source    destination 
ACCEPT  tcp -- anywhere    anywhere   tcp dpt:61616 
ACCEPT  udp -- anywhere    anywhere   udp dpt:cslistener 
ACCEPT  tcp -- anywhere    anywhere   tcp dpt:cslistener 
ACCEPT  tcp -- anywhere    anywhere   tcp dpt:webcache 
ACCEPT  tcp -- anywhere    anywhere   tcp dpt:smtp 
RH-Firewall-1-INPUT all -- anywhere    anywhere 

Chain FORWARD (policy ACCEPT) 
target  prot opt source    destination 
RH-Firewall-1-INPUT all -- anywhere    anywhere 

Chain OUTPUT (policy ACCEPT) 
target  prot opt source    destination 

Chain RH-Firewall-1-INPUT (2 references) 
target  prot opt source    destination 
ACCEPT  tcp -- anywhere    anywhere   tcp dpt:61616 
ACCEPT  tcp -- anywhere    anywhere   tcp dpt:http 
ACCEPT  all -- anywhere    anywhere 
ACCEPT  icmp -- anywhere    anywhere   icmp any 
ACCEPT  esp -- anywhere    anywhere 
ACCEPT  ah -- anywhere    anywhere 
ACCEPT  udp -- anywhere    224.0.0.251   udp dpt:mdns 
ACCEPT  udp -- anywhere    anywhere   udp dpt:ipp 
ACCEPT  tcp -- anywhere    anywhere   tcp dpt:ipp 
ACCEPT  all -- anywhere    anywhere   state RELATED,ESTABLISHED 
ACCEPT  tcp -- anywhere    anywhere   state NEW tcp dpt:ssh 
REJECT  all -- anywhere    anywhere   reject-with icmp-host-prohibited 

多達但我不懂iptables的,有什麼讓我困惑的是,HTTP端口是從外部可見,但端口61616仍然是沒有的。對我來說,規則看起來是一樣的。無論如何,所有幫助的讚賞。

最佳

+0

看起來不錯,端口應該是開放的。你如何測試?你確定它是一個不是UDP的TCP端口嗎? – Sorin 2012-02-01 13:20:26

+0

使用'iptables -L -v'會顯示哪些規則正在匹配。有沒有在該端口上運行的服務?你的測試系統和你的服務器之間可能還有另一個防火牆嗎? – 2012-02-09 15:05:35

回答

0

也許你試着CentOS的主機背後的網絡中打開端口的主機(CentOS的主機是網絡防火牆)? 如果是這樣,您必須添加規則表濾波器鏈FORWARD,並在網絡DNAT你應該 添加規則以一些IP X.X.X.X上述

iptables -A FORWARD -p tcp --dport 61616 -j ACCEPT 
iptables -A PREROUTING -t nat -p tcp --dport 61616 -j DNAT --to-destinanion x.x.x.x