On Centos 6 machine, how can I block port 8888 from being accessed except by localhost/127.0.0.1 only using iptables? Actually, I have another port that I want to listen on 8000 instead of 8888.
This command blocks access to localhost:8888
iptables -I INPUT -p tcp --dport 8888 -j DROP
I don't want access to 22.214.171.124:8888 but only to localhost:8888