Search code examples
geoipmaxmind

Converting GeoLite2 data for use with xtables geoip


My apologies if this has been covered here or elsewhere. I read the postings back to 2016.

My debian system stopped updating the xtables geoip database. On investigation it developed that this is because Maxmind dropped support for legacy GeoIP databases. I have got as far as installing and configuring Maxmind's geoipupdate program for the GeoLite2 database and scheduling it weekly in crontab.

At this point I am stumped. geoipupdate returns a .mmdb database. This is not usable by the debian-supplied scripts which convert .CSV files to the country code files in /usr/share/xt_geoip/LE and /usr/share/xt_geoip/BE.

The debian package xtables-addons has not been updated to deal with this situation.

Assistance or a pointer to a solution will be gratefully received. At present I am still using the last valid database which is now getting to be over six months old.


Solution

  • Have a look at GeoLite2xtables :- https://github.com/mschmitt/GeoLite2xtables

    You can download a zip (or git clone). It has example workflow (shell commands) for legacy GeoLite CSV (which is probably what you have which stopped working in early Jan 2019) and GeoLite2 CSV (which you can use instead).