CloudFlare iptables rules

last modified : 2015-03-17 | published: 2015-04-30 | category:

iptables -N CLOUDFLARE
iptables -t filter -A CLOUDFLARE -p tcp -m multiport --dports http,https -s 199.27.128.0/21 -j ACCEPT
iptables -t filter -A CLOUDFLARE -p tcp -m multiport --dports http,https -s 173.245.48.0/20 -j ACCEPT
iptables -t filter -A CLOUDFLARE -p tcp -m multiport --dports http,https -s 103.21.244.0/22 -j ACCEPT
iptables -t filter -A CLOUDFLARE -p tcp -m multiport --dports http,https -s 103.22.200.0/22 -j ACCEPT
iptables -t filter -A CLOUDFLARE -p tcp -m multiport --dports http,https -s 103.31.4.0/22 -j ACCEPT
iptables -t filter -A CLOUDFLARE -p tcp -m multiport --dports http,https -s 141.101.64.0/18 -j ACCEPT
iptables -t filter -A CLOUDFLARE -p tcp -m multiport --dports http,https -s 108.162.192.0/18 -j ACCEPT
iptables -t filter -A CLOUDFLARE -p tcp -m multiport --dports http,https -s 190.93.240.0/20 -j ACCEPT
iptables -t filter -A CLOUDFLARE -p tcp -m multiport --dports http,https -s 188.114.96.0/20 -j ACCEPT
iptables -t filter -A CLOUDFLARE -p tcp -m multiport --dports http,https -s 197.234.240.0/22 -j ACCEPT
iptables -t filter -A CLOUDFLARE -p tcp -m multiport --dports http,https -s 198.41.128.0/17 -j ACCEPT
iptables -t filter -A CLOUDFLARE -p tcp -m multiport --dports http,https -s 162.158.0.0/15 -j ACCEPT
iptables -t filter -A CLOUDFLARE -p tcp -m multiport --dports http,https -s 104.16.0.0/12 -j ACCEPT
iptables -A INPUT -i eth0 -j CLOUDFLARE