OPNsense Forum

Archive => 22.7 Legacy Series => Topic started by: tokar86a on June 25, 2023, 11:03:36 AM

Title: Geoip and Ntopng
Post by: tokar86a on June 25, 2023, 11:03:36 AM
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?

Title: Re: Geoip and Ntopng
Post by: cookiemonster on June 26, 2023, 01:33:01 PM
"No address record"
Please check that the machine this is trying the download from can resolve the name i.e DNS settings.
Title: Re: Geoip and Ntopng
Post by: tokar86a on June 27, 2023, 07:50:51 AM
Yes it seems like the script is trying to download files from a invalid link. So the included script is not working any more.
Title: Re: Geoip and Ntopng
Post by: cookiemonster on June 27, 2023, 10:21:38 AM
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
Title: Re: Geoip and Ntopng
Post by: tokar86a on June 27, 2023, 10:19:15 PM
I was following the instructions from the console log that told me to run the ntopng-geoip2update.sh
Title: Re: Geoip and Ntopng
Post by: cookiemonster on June 27, 2023, 11:26:31 PM
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
Title: Re: Geoip and Ntopng
Post by: danderson on August 10, 2023, 11:39:01 PM
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)