Created
April 21, 2015 09:22
-
-
Save wardbekker/f206021ad0e5cdbbe622 to your computer and use it in GitHub Desktop.
Cloudflare ipv4 iptable rules
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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