Giter Site home page Giter Site logo

davie3 / mikrotik-cloudflare-iplist Goto Github PK

View Code? Open in Web Editor NEW
34.0 2.0 7.0 273 KB

Generate Mikrotik Address Lists for Cloudflare's IP ranges

Python 22.47% Shell 9.33% RouterOS Script 68.21%
cloudflare dns ip ipv4 ipv6 mikrotik routerboard routeros routeros-scripts script

mikrotik-cloudflare-iplist's Introduction

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 my automation will run frequently to generate the lists: cloudflare-ips-v4.rsc and cloudflare-ips-v6.rsc.

Always use caution and backup your Mikrotik configurations!

2022-05-06 19_51_07 - WinBox (64bit) v7 2 3 on hEX (mmips)

2022-05-06 19_49_40- WinBox (64bit) v7 2 3 on hEX (mmips)

Usage

Simpliest Way

  • Download install.rsc and/or install-v6.rsc and upload them to your Mikrotik Router
  • Run /import file-name=install.rsc and/or /import file-name=install-v6.rsc from the Mikrotik terminal
  • d3-cloudflare-download and d3-cloudflare-replace will now be added to your Scripts
  • d3-cf-dl and d3-cf-rp will 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

  • 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 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

mikrotik-cloudflare-iplist's People

Contributors

davie3 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.