I am currently using this to block ports in my server but I think this is not the best way. Can you please give the proper way to do this?
Code:
iptables -A FORWARD -j DROP -p tcp --dport $PORT -i eth+
iptables -A FORWARD -j DROP -p tcp --dport $PORT -o eth+
iptables -A INPUT -j DROP -p tcp --dport $PORT -i eth+
iptables -A OUTPUT -j DROP - -p tcp --dport $PORT -o eth+
Thank you