cannot open port 8080

Posted April 21, 2014 12.9k views
hi i am a newbie and i want to open port 8080 . i have added this iptables -A INPUT -p tcp -m tcp --dport 8080 -j ACCEPT in /etc/sysconfig/iptables and then service iptables restart but with no success

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
5 answers
You need to get rid of "iptables" if you want to edit /etc/sysconfig/iptables directly. So the line would look like this:
-A INPUT -p tcp -m tcp --dport 8080 -j ACCEPT
From what you have wrote above you added in '/etc/sysconfig/iptables' the word iptables before the rule, the word iptables + rule is used only when you want to add a new rule from the terminal, "iptables" shouldn't be in the file.
Hope I helped. :)
Hi thanks for the quick response. I have removed the iptables and try to add the line in the config file of iptables as you both stated but i was not successfull in opening the port 8080 .can you plrase let me know the detail steps . thanks a lot for your time and the knowledge you have provided me . I would be really appreciate if you could let me know the steps to open port 8080
What's the output of "iptables -nL"

i’m with the same problem. My output for “iptables -nL” was:

Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination