Community discussions

MikroTik App
 
elico
Member Candidate
Member Candidate
Topic Author
Posts: 147
Joined: Mon Nov 07, 2016 3:23 am

Updating GeoIP address lists from this git

Mon Jun 19, 2023 12:05 am

I have tried couple scripts that will create a BLOCK or ALLOW ipv4 firewall address lists.
The main issue was that some scripts are too long for RouterOS import.
I want to use the next github repo:
https://github.com/herrbischoff/country-ip-blocks

to take a specific set of countries lists and add them to the address list.
The only scriptable way I can think is that will work is via the rest API.

Since it's not possible to do with existing RouterOS mechanisms I think a container might work.
So, the first thing is to get the list and then pass validate the data and pass it to curl with xargs in parallel of 5-10.
An example for usage can be seen at:
https://gist.github.com/elico/62dd7eed0 ... 18bcbfdb2c

assuming you are running it in the cloned git directory.

and yes, I have tried to use:
https://mikrotikconfig.com/firewall/

which is great for specific use cases but not mine.

An idea would be a container which contains a web service that can be requested to push a list into a remote RouterOS device with the login details in the request. This would allow the service to run without any saved credentials of the RouterOS device and in turn can be triggered by a schedule task from the RouterOS device.
 
elico
Member Candidate
Member Candidate
Topic Author
Posts: 147
Joined: Mon Nov 07, 2016 3:23 am

Re: Updating GeoIP address lists from this git

Thu Mar 14, 2024 11:39 am

Now I'm looking for the right way to remove a specific record with a single POST request :\

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 3 guests