Skip to content

Instantly share code, notes, and snippets.

@wardbekker
Created April 21, 2015 09:22
Show Gist options
  • Save wardbekker/f206021ad0e5cdbbe622 to your computer and use it in GitHub Desktop.
Save wardbekker/f206021ad0e5cdbbe622 to your computer and use it in GitHub Desktop.
Cloudflare ipv4 iptable rules
for i in `curl https://www.cloudflare.com/ips-v4`; do iptables -I INPUT -p tcp -s $i -m multiport --dports http,https -j ACCEPT; done
iptables -A INPUT -p tcp --dport http -j DROP
iptables -A INPUT -p tcp --dport https -j DROP
iptables-save > /etc/iptables/rules.v4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment