Quantcast
Viewing all articles
Browse latest Browse all 41

Answer by Daniele Santi for Blocking ports with iptables

First of all, default policy for OUTPUT Chain is ACCEPT, so the last line:

ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED

isn't necessary.

Then the first line:

ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED

is redundant too because default policy for INPUT is ACCEPT.

Try with only these two rules and see if it helps:

iptables -A INPUT -d IP -m state --state ESTABLISHED,RELATED -j ACCEPTiptables -A INPUT -d IP -j DROP

Viewing all articles
Browse latest Browse all 41

Trending Articles