How to open a 8080 port for an application, with iptables
I am a total newbie concerning servers so excuse my humble question :-)
Someone developed for me a python application that acts as a web serveur. This TCP application needs to listen to port 8080.
[root@blabla jll]# netstat -tanpu | grep ":8080"
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 18209/python
It seems that 8080 is not opened on my server firewall. To open it, I tried to modify iptables rules like this :
/sbin/iptables -A RH-Firewall-1-INPUT -i eth0 -p tcp --dport 8080 -j ACCEPT
However I still have nothing at http://my.server.name:8080.
(I am not even sure about "RH-Firewall-1-INPUT" or "INPUT")
What can I do now ? Is there some kind of general procedure for such things ?
I give you the following usefull info :
/sbin/iptables -nvL
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
49 3388 ACCEPT tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:8080
25M 3736M RH-Firewall-1-INPUT all -- * * 0.0.0.0/0 0.0.0.0/0
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 REJECT all -- * * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited
Chain OUTPUT (policy ACCEPT 43M packets, 41G bytes)
pkts bytes target prot opt in out source destination
Chain RH-Firewall-1-INPUT (1 references)
pkts bytes target prot opt in out source destination
121K 15M ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0
97773 8078K ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0 icmp type 255
0 0 ACCEPT esp -- * * 0.0.0.0/0 0.0.0.0/0
0 0 ACCEPT ah -- * * 0.0.0.0/0 0.0.0.0/0
17 2509 ACCEPT udp -- * * 0.0.0.0/0 224.0.0.251 udp dpt:5353
0 0 ACCEPT udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:631
0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:631
24M 3682M ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
26069 1319K ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22
3806 204K ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:443
563K 30M REJECT all -- * * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited
And :
/sbin/iptables -nvL -t nat
Chain PREROUTING (policy ACCEPT 168K packets, 15M bytes)
pkts bytes target prot opt in out source destination
Chain POSTROUTING (policy ACCEPT 4200K packets, 252M bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 4200K packets, 252M bytes)
pkts bytes target prot opt in out source destination
Barring the output of iptables -nvL
, iptables -nvL -t nat
and iptables -nVL -t mangle
, which would be useful to have in this case, here is a quickie that might work:
iptables -I INPUT 1 -i eth0 -p tcp --dport 8080 -j ACCEPT