Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Feature Request: Support for other GeoIP2 databases? #199

Closed
AnthonyBe opened this issue Jan 30, 2021 · 3 comments
Closed

Feature Request: Support for other GeoIP2 databases? #199

AnthonyBe opened this issue Jan 30, 2021 · 3 comments

Comments

@AnthonyBe
Copy link
Contributor

I'm wondering if anyone is working on, or if it is even viable, plugin modules for:

  1. the other free Maxmind GeoLite2 database (GeoLite2 ASN), or
  2. the GeoIP2 commercial databases?

Commercial: Anonymous IP, Connection Type, Domain, ISP
https://www.maxmind.com/en/geoip2-databases
https://dev.maxmind.com/geoip/geoip2/downloadable

@visualperception
Copy link
Contributor

using the following you can generate an ASN geoip.dat file from the free geoip2 files

https://github.com/sherpya/geolite2legacy

@AnthonyBe
Copy link
Contributor Author

using the following you can generate an ASN geoip.dat file from the free geoip2 files

https://github.com/sherpya/geolite2legacy

Oh cool! Thank you so much for sharing that. I'll check it out!

@AnthonyBe
Copy link
Contributor Author

AnthonyBe commented Feb 16, 2021

Thanks @visualperception - works perfectly.

For the record in case anyone else wants to use this (I'm running on Windows):

  1. I'm using curl to download GeoLite2-ASN-CSV.zip from Maxmind's permalink
  2. Then using geolite2legacy to convert the downloaded file into the GeoIPASNum.dat format that AWStats can use.

I've got the following in a script scheduled to run weekly:
NOTE: in script below, YOUR_LICENSE_KEY needs to be replaced by your Maxmind license key (this is free version)

curl "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-ASN-CSV&license_key=YOUR_LICENSE_KEY&suffix=zip" --output GeoLite2-ASN-CSV.zip

python geolite2legacy.py -i GeoLite2-ASN-CSV.zip -o GeoIPASNum.dat 

geolite2legacy is in Python. I'm using Python 3.9.1 for Windows. You will need to install ipaddr Python module

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants