Skip to content
May 24 / Greg

Convert CIDR Addresses For Use With Mikrotik Firewall

CountryIPBlocks has a method to easily grab the CIDR blocks for various countries. They have methods to put these in formats for Cisco and such…though they don’t have one for Mikrotik.

So, I wrote a lil program that will create address lists with firewall rules or just firewall rules based on these address blocks. What you do is paste in the output from CIDR notation and click the convert button…easy enough!

Download the program and code here: mtkCIDR (3598 downloads)

Here’s the pasted results:

/ip firewall address-list
add address= disabled=no list=BlockAnguilla
add address= disabled=no list=BlockAnguilla
/ip firewall filter
add action=reject disabled=no chain=forward comment="BlockAnguilla drop" src-address-list=BlockAnguilla
add action=reject disabled=no chain=input comment="BlockAnguilla drop" src-address-list=BlockAnguilla
Leave a Comment