1

This question already has an answer here:

Recently I added to iptables a rule which was supposed to allow incoming traffic through port 993. The rule I used is the one shown below:

sudo iptables -A INPUT -p tcp --dport 993 -j ACCEPT

After I entered the rule, I ran "iptables-save > /etc/iptables/rules.v4" and rebooted the server. However when I use the telnet command to check the port I am getting following error.

telnet localhost 993

it tells me the connection is refused by the host (my server). This is not only happening to this port but to other ports I try to open. Am I doing something wrong, running a wrong command, etc? Please help me.

marked as duplicate by Michael Hampton Apr 2 '16 at 4:50

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

0

-A appends the rule to the end of the list of rules. So if a previous rule drops the packet, the packet is not going to be accepted. Use -I instead of -A. Also, check if a rule in other tables or in chain PREROUTING drops the packet.

Not the answer you're looking for? Browse other questions tagged or ask your own question.