Geoip and Ntopng

Started by tokar86a, June 25, 2023, 11:03:36 AM

Previous topic - Next topic
I have install Ntopng and run this script

ntopng supports IP geolocation, to enable this you should use the
ntopng-geoip2update.sh script to update the maxminddb geolocation
data to the latest version.

And that return whit

Fetching GeoLite2-City
fetch: https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz: No address record
GeoLite2-City.tar.gz download failed

Something wrong whit the script? Maybe it needs updating?


"No address record"
Please check that the machine this is trying the download from can resolve the name i.e DNS settings.

Yes it seems like the script is trying to download files from a invalid link. So the included script is not working any more.

I don't know what instructions you are following but maxmind changed a little a while ago. If you go to https://www.maxmind.com you need to sign up to a free account to then be able to get to downloads. And yes, the url will be different, hence this error.
They are in the form of https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=YOUR_LICENSE_KEY&suffix=tar.gz

I was following the instructions from the console log that told me to run the ntopng-geoip2update.sh

Ok fair enough. I'll ask the question in github. I don't use ntopng but it can't hurt to ask.
https://github.com/opnsense/ports/issues/174

they merged an updated ntopng-geoip2update.sh in the last few weeks, but opnsense has not created the file /usr/local/etc/GeoIP.conf with the license key.   They already have a license key if you use it under firewall > aliases > geoip in the URL string your supposed to use. 

aka "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=YOUR_LICENSE_KEY&suffix=tar.gz"

I modified one line in the ntopng-geoip2update.sh
it pulls the license key from the URL for GeoIP in the opnsense config file.

LICENSE_KEY=$(awk -F '&amp;|license_key=' '/<url>/''{print $3}' /conf/config.xml)