Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sr3d/120731 to your computer and use it in GitHub Desktop.
Save sr3d/120731 to your computer and use it in GitHub Desktop.
sudo iptables -F
sudo iptables -A INPUT -i lo -j ACCEPT
sudo iptables -A INPUT -i ! lo -d 127.0.0.0/8 -j REJECT
sudo iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
sudo iptables -A OUTPUT -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 10000 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 443 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 3333 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 3000 -j ACCEPT
sudo iptables -A INPUT -p tcp -m state --state NEW --dport 22000 -j ACCEPT
sudo iptables -A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT
sudo iptables -A INPUT -j REJECT
sudo iptables -A FORWARD -j REJECT
sudo service iptables save
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment