United StatesDavie3/mikrotik-cloudflare-iplist
Generate Mikrotik Address Lists for Cloudflare's IP ranges
Mikrotik Cloudflare IP Address List
Generate Mikrotik Address Lists for Cloudflare's IP ranges.
Once created, these address lists can be used to filter Web traffic on your Mikrotik Router to only come from Cloudflare's proxied IPs. Available lists for IPv4 and IPv6 Addresses.
Cloudflare does not change these IPs often, but GitHub Actions will run at 8am UTC (12am PT) and 8pm UTC (12pm PT) to generate the lists: cloudflare-ips-v4.rsc and cloudflare-ips-v6.rsc.
Always use caution and backup your Mikrotik configurations!


Usage
Simpliest Way
- Download install.rsc and/or install-v6.rsc and upload them to your Mikrotik Router
- Run
/import file-name=install.rscand/or/import file-name=install-v6.rscfrom the Mikrotik terminal d3-cloudflare-downloadandd3-cloudflare-replacewill now be added to your Scriptsd3-cf-dlandd3-cf-rpwill be added to the Scheduler- By default, the download script will run everyday at 00:05:00 and the replace script at 00:10:00. Adjust the frequency and time as needed
Manual Way
Adjust for cloudflare-ips-v4.rsc and/or cloudflare-ips-v6.rsc depending on what you need, manually create both scripts, and add the schedule.
- Manually create the download script
:log info "Download Cloudflare IP list"; /tool fetch url="https://raw.githubusercontent.com/Davie3/mikrotik-cloudflare-iplist/main/cloudflare-ips-v4.rsc" mode=https check-certificate=yes-without-crl dst-path=cloudflare-ips-v4.rsc; - Manually create the replace script
:log info "Remove current Cloudflare IPs"; /ip firewall address-list remove [find where list="cloudflare-ips"]; :log info "Import newest Cloudflare IPs"; /import file-name=cloudflare-ips-v4.rsc; - Schedule a job for both scripts making sure the download script runs a few minutes before the replace script
Hardening
A few notes for security-conscious users:
- The
.rsclists are regenerated by a GitHub Actions workflow (update_iplists.yml) and every change is committed to this repo —git logandgit blameare the audit trail. - The installer scripts pass
check-certificate=yes-without-crlto/tool fetchso RouterOS validates GitHub's TLS certificate. If you wrote your own download script before this was added, consider adding the same flag to defeat MitM tampering. - If you fork this repo, keep the workflow's
permissions:scoped, keep actions pinned by SHA, and turn on Dependabot — the workflow in this repo is the reference setup.
Similar Projects
Discover other similar projects and AI models.
IP Address Collection and Management Service with multiple output formats: mikrotik, json, text, ipset, nfset, clashx, keenetic, switchy, amnezia
💻 a library for parsing and manipulating IPv4 and IPv6 addresses in JavaScript
Mikrotik configuration files for a moderately complex home network with managed access points, FTTH with authentication, multiple ISPs with failover, secure DNS, and VLANs.
⚡️ IPTV直播源自动更新工具:自动采集、校验、测速并生成可播放结果,支持 M3U/TXT/API 输出、自定义频道、IPv4/IPv6、Docker、GitHub Actions、CLI 与 GUI 多端部署
The best IP Toolbox. Check your IP address & geolocation, test IP for WebRTC and DNS IP leaks, run an IP quality check, browser fingerprint check, website availability check, network speed test, global latency test, MTR test, Whois search, and more.
🌚 🌍 🌝 GeoIP 增强版,自由定制多种格式 GeoIP 文件,包括但不限于 V2Ray dat 格式文件 geoip.dat、MaxMind mmdb 格式文件、sing-box SRS 格式文件、mihomo MRS 格式文件、Clash ruleset、Surge ruleset、Nginx allow & deny 规则文件等。Enhanced edition of GeoIP for Nginx, V2Ray, Xray-core, Clash, mihomo, sing-box, Shadowrocket, Quantumult X, Surge, hysteria, Trojan-Go, dae, etc.