Skip to content

Instantly share code, notes, and snippets.

@Laica-Lunasys
Last active March 29, 2017 20:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Laica-Lunasys/53a403251edb3d9f44fbe022fd0273f3 to your computer and use it in GitHub Desktop.
Save Laica-Lunasys/53a403251edb3d9f44fbe022fd0273f3 to your computer and use it in GitHub Desktop.
# Allow only CloudFlare
for cf in $(curl https://www.cloudflare.com/ips-v4); do
echo -e "-> Adding CloudFlare IPs: $cf"
  iptables -A INPUT -p tcp -m multiport --dports 80,443 -s "$cf" -j ACCEPT
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment