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 (2111)


Here’s the pasted results:

1
2
3
4
5
6
/ip firewall address-list
add address=204.14.248.0/21 disabled=no list=BlockAnguilla
add address=208.66.48.0/21 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

 

*