/cloudflareip-to-csf

This bash script automates daily updates of CloudFlare IP lists on a server. It retrieves IPv4 and IPv6 addresses, updates csf/cloudflare.allow, and modifies csf.allow and csf.ignore accordingly. The script restarts CSF/LFD and creates a daily cron job for automation, ensuring up-to-date CloudFlare IP configurations.

Primary LanguageShellApache License 2.0Apache-2.0

CloudFlare IP Update Script for CSF (ConfigServer Firewall)

This Bash script, automates the daily update of CloudFlare IP lists on a server. It performs the following tasks:

  1. Retrieves current CloudFlare IPv4 and IPv6 addresses.
  2. Updates the csf/cloudflare.allow file with the new IPs.
  3. Modifies csf.allow and csf.ignore files accordingly.
  4. Restarts CSF/LFD (ConfigServer Firewall and Login Failure Daemon).
  5. Creates a daily cron job for continuous automation.

How to Run

To execute the script, run the following command:

bash <(curl -s https://raw.githubusercontent.com/mhos/cloudflareip-to-csf/main/cloudflare_ip_csf.sh)