Geofencing helper for Mikrotik
Because someone is NOT welcome here
Run image and expose service, say, at http://thangail.lan:8080
docker run --rm -p 8080:80 ghcr.io/orhideous/thangail:0.1.1
Then, on MikroTik:
# Add firewall rules
/ip firewall raw add chain=prerouting action=drop src-address-list=thangail
/ipv6 firewall raw add chain=prerouting action=drop src-address-list=thangail
# Download and import IPv4 rules
/tool fetch url="http://thangail.lan:8080/api/v0/list?country=cn&name=thangail&timeout=60d&version=v4" dst-path=v4.list
/import v4.list
/file remove v4.list
# Download and import IPv6 rules
/tool fetch url="http://thangail.lan:8080/api/v0/list?country=cn&name=thangail&timeout=60d&version=v6" dst-path=v6.list
/import v6.list
/file remove v6.list
Rinse and repeat every 60 days, and keep an eye on memory/CPU usage.
So what?
Good, you shouldn't. Self-host it.
PRs are welcome.
RIR, compiled by Marcel Bischoff here: herrbischoff/country-ip-blocks.