OPNsense Forum

English Forums => General Discussion => Topic started by: Tonton Jo on October 16, 2026, 04:11:02 PM

Title: Free GeoIP Database to use with Opnsense
Post by: Tonton Jo on October 16, 2026, 04:11:02 PM
Hi!

Not sure if it's the right place, but i wanted to share this:

I've vibecoded a script that generate a geoIP database from scratch that matches the requirements in terms of format for Opnsense.

(https://private-user-images.githubusercontent.com/60965766/674740161-dc16df01-9a59-4f8a-bc44-9f1750a7b26c.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3OTIwNzUwNzYsIm5iZiI6MTc5MjA3NDc3NiwicGF0aCI6Ii82MDk2NTc2Ni82NzQ3NDAxNjEtZGMxNmRmMDEtOWE1OS00ZjhhLWJjNDQtOWYxNzUwYTdiMjZjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjEwMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYxMDE1VDE0MzI1NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWE1NDA3ODU4NTljNjBiZDZkODdlZjQ3OTlmOThhNjFhNDcxM2MzMmMyZGY5M2M5ZDIzMjlhOTY3ZGVjYTRlM2QmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JnJlc3BvbnNlLWNvbnRlbnQtdHlwZT1pbWFnZSUyRnBuZyJ9.TbmZ_h6gYPBlRPPEAjb-r7DgBWHiI6ddOC0amaK25BM)


The database can be downloaded here and will be automatically updated:
https://github.com/Tontonjo/opnsense/releases/download/geoip/GeoLite2-Country-CSV.zip

Find the scripts for both bash and Powershell usage if you need to self-host here:
https://github.com/Tontonjo/opnsense/tree/main/geoip

Let me know if you find this usefull :)

PS: Sorry for the repost

Regards

Jo
Title: Re: Free GeoIP Database to use with Opnsense
Post by: cookiemonster on October 16, 2026, 10:19:32 PM
What's wrong with using the built-in functionality https://docs.opnsense.org/manual/aliases.html#geoip ?
Title: Re: Free GeoIP Database to use with Opnsense
Post by: Patrick M. Hausen on October 16, 2026, 10:25:43 PM
They are providing a database that could be used by the builtin functionality. As an alternative to Maxmind or IPinfo.

Not sure if this is a permitted use of Internet registry info, though.
Title: Re: Free GeoIP Database to use with Opnsense
Post by: cookiemonster on October 16, 2026, 10:30:59 PM
I see the intended use, thanks Patrick. Indeed is a redistribution.
Title: Re: Free GeoIP Database to use with Opnsense
Post by: pfry on October 17, 2026, 12:18:55 AM
Quote from: Patrick M. Hausen on October 16, 2026, 10:25:43 PM[...]Not sure if this is a permitted use of Internet registry info, though.

I imagine all use it at some level. The RPSL registries might give some useful additional info (mainly origin AS), but even that may not provide useful geolocation. I haven't looked at the RADB in years... not sure what's become of it or other IRRs. The RIRs were generally better maintained... heh. A few BGP tables from various route servers could provide additional data. Might be hard to avoid being a pest while gathering said data, although that says more about the infrastructure than the task itself. Too, things might be different these days.