Geoip and Ntopng

Started by andrema2, June 04, 2020, 04:58:28 PM

Previous topic - Next topic
Hi,

I'm having trouble to make geoip work. I didn't find geoip.conf file to add my key and also the geoipupdate seems to have not been installed.

I installed the version 4 and reverted to 20.1.3 to avoid the issues with the new version. I don't know if it screwed up something else.


Quote from: andrema2 on June 04, 2020, 04:58:28 PM
I'm having trouble to make geoip work. I didn't find geoip.conf file to add my key and also the geoipupdate seems to have not been installed.

I think it's a problem with the latest version of OPNsense and/or ntopng... someone in this forum suggested the following manual steps:

1) Get the following files from MaxMind:

     GeoLite2-ASN.mmdb
     GeoLite2-Country.mmdb
     GeoLite2-City.mmdb

2) Copy those files to /usr/local/share/ntopng/httpdocs/geoip/


3) chmod +x /usr/local/opnsense/scripts/OPNsense/Ntopng/generate_certs.php

Quote from: hushcoden on June 04, 2020, 08:14:30 PM

3) chmod +x /usr/local/opnsense/scripts/OPNsense/Ntopng/generate_certs.php

I dont know the solution, but this one can't be it.

QuoteI dont know the solution, but this one can't be it.

That was part of the three step solution to enabling GeoIP in a youtube video which solved my problem months ago.  I can't say that chmod step does anything, but copying the files worked.

Ref:  https://youtu.be/MywgacMD_GI?t=178
HP T730/AMD  RX-427BB/8GB/500GB SSD
HP NC365T 4-PORT

Hi

I reinstalled everything from the scratch with the 20.1.8_1 and the geoipupdate is not there.
My understanding is that it won't update the databases without it. I can copy the database and it will work with the version I copy but no updates.

Any permanent solution ?

July 28, 2020, 10:29:25 AM #5 Last Edit: July 28, 2020, 10:41:37 AM by uglymotha
Attached an updated version of ntopng-geoip2update.sh
Replace the script currently in /usr/local/bin
Follow instructions on https://github.com/ntop/ntopng/blob/dev/doc/README.geolocation.md
Copy GeoIP.conf to /usr/local/etc (or any other location and specify it on command line)
Schedule script in cron

add to /usr/local/opnsense/service/conf/actions.d/actions_ntopng.conf to schedule from GUI
[update]
command:/usr/local/bin/ntopng-geoip2update.sh
parameters:
type:script
message:Updating ntopng GeoIP
description:Update ntopng GeoIP Database files

Quote from: uglymotha on July 28, 2020, 10:29:25 AM
Attached an updated version of ntopng-geoip2update.sh
Replace the script currently in /usr/local/bin
Follow instructions on https://github.com/ntop/ntopng/blob/dev/doc/README.geolocation.md
Copy GeoIP.conf to /usr/local/etc (or any other location and specify it on command line)
Schedule script in cron

add to /usr/local/opnsense/service/conf/actions.d/actions_ntopng.conf to schedule from GUI
[update]
command:/usr/local/bin/ntopng-geoip2update.sh
parameters:
type:script
message:Updating ntopng GeoIP
description:Update ntopng GeoIP Database files

Shall we pack this in the plugin itself?

Quote from: mimugmail on July 28, 2020, 11:37:00 AM
Shall we pack this in the plugin itself?

Sure, feel free to do so

small hint, a newly generated GeoIP.conf from the maxmind website generate a version with an "EditionIDs" string but must be an "ProductIds". After the change everything works great, thanks for the updated script mimugmail.

Maybe silly question, my licence key goes in the script, right ?

Not silly. I cannot see where you specify the conf file either, I downloaded the Maxmind files manually and it works nicely, would be good to get the script working though. Someone point me in the right direction?
OPNsense 24.7 - Qotom Q355G4 - ISP - Squirrel 1Gbps.

Team Rebellion Member