Skip to content

Instantly share code, notes, and snippets.

@rojenzaman
Created July 9, 2020 17:08
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 rojenzaman/ec04d97966134ed7fe24a2faa813cc46 to your computer and use it in GitHub Desktop.
Save rojenzaman/ec04d97966134ed7fe24a2faa813cc46 to your computer and use it in GitHub Desktop.
UFW Rules Update for Cloudflare CDN
#!/bin/bash
cd /root/cf
curl https://www.cloudflare.com/ips-v4 > ips-v4
curl https://www.cloudflare.com/ips-v6 > ips-v6
for i in `<ips-v4`; do ufw allow from $i proto tcp to any port 80,443; done
for i in `<ips-v6`; do ufw allow from $i proto tcp to any port 80,443; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment