Skip to content

Commit

Permalink
Merge pull request Paul-Reed#2 from samirmh-dev/patch-1
Browse files Browse the repository at this point in the history
Fixed bad port error
  • Loading branch information
Paul-Reed authored Jan 6, 2020
2 parents 1f86897 + cc6a6f8 commit 4319e42
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cloudflare-ufw.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ curl -s https://www.cloudflare.com/ips-v4 -o /tmp/cf_ips
curl -s https://www.cloudflare.com/ips-v6 >> /tmp/cf_ips

# Allow all traffic from Cloudflare IPs (no ports restriction)
for cfip in `cat /tmp/cf_ips`; do ufw allow from $cfip comment 'Cloudflare IP'; done
for cfip in `cat /tmp/cf_ips`; do ufw allow proto tcp from $cfip comment 'Cloudflare IP'; done

ufw reload > /dev/null

# OTHER EXAMPLE RULES
# Retrict to port 80
#for cfip in `cat /tmp/cf_ips`; do ufw allow from $cfip to any port 80/tcp comment 'Cloudflare IP'; done
#for cfip in `cat /tmp/cf_ips`; do ufw allow proto tcp from $cfip to any port 80 comment 'Cloudflare IP'; done

# Restrict to port 443
#for cfip in `cat /tmp/cf_ips`; do ufw allow from $cfip to any port 443/tcp comment 'Cloudflare IP'; done
#for cfip in `cat /tmp/cf_ips`; do ufw allow proto tcp from $cfip to any port 443 comment 'Cloudflare IP'; done

# Restrict to ports 80 & 443
#for cfip in `cat /tmp/cf_ips`; do ufw allow from $cfip to any port 80,443/tcp comment 'Cloudflare IP'; done
#for cfip in `cat /tmp/cf_ips`; do ufw allow proto tcp from $cfip to any port 80,443 comment 'Cloudflare IP'; done

0 comments on commit 4319e42

Please sign in to comment.