Skip to content

Instantly share code, notes, and snippets.

@R-Nabil
R-Nabil / cloudflare_ufw_ip.sh
Last active January 24, 2023 01:16
Update UFW with Cloudflare IP, by deleting them first and recreating based on the retrieve IP list.
# Informational only
ctrDelete=0
ctrAdd=0
# The below script update UFW rules to allow only Cloudflare IP through.
# It is only done for port 443 but can easily be extended to other ports
#
# First step is to delete already existing Cloudflare UFW rules.
# It is done by looking for the ones with comment 'Cloudflare IP'
#