GeoIP2 is a library that helps determine the country where an IP address or a hostname is located. It uses free file-based MaxMind GeoLite2 geolocation databases (Country, Country IPv6, City, and ASN).
A database contains blocks of IP addresses as keys, and countries/cities/ASNs as values. Such a database is more complete and accurate than the data obtained by using reverse DNS lookups.
Important. Starting from version 19.01, Flussonic Media Server supports GeoIP2 format of the database, the GeoIP format is no longer supported by Flussonic.
How GeoIP2 data is used in Flussonic Media Server
With the GeoIP2 databases, you can allow access to a stream only from certain countries by adding the line like this in the stream's settings:
allowed_countries RU UA KZ;
By default, Flussonic uses the GeoIP2 library that comes with Flussonic and contains a single database
GeoLite2 Country. The database is located in the
/opt/flussonic/lib/egeoip2/priv/ directory on the Flussonic server:
This database is updated automatically together with Flussonic updates. Do not update it manually.
New releases of GeoIP2 databases come out more often than the releases of Flussonic server, so sometimes the database in
/opt/flussonic/lib/egeoip2/priv/ might become outdated.
Install a separate GeoIP2 library and set up Flussonic to use it. This will let you:
- Use the most recent GeoIP2 data — you'll be able to update the databases as often as you wish, without updating Flussonic.
- Use not only the Country database, but also City or ASN.
To use a separate GeoIP2 library:
Install GeoIP2 databases.
For installation and update instructions, visit the MaxMind website at https://dev.maxmind.com/geoip/geoipupdate
To the Flussonic configuration file, add the option
geoip PATH_TO_DATABASE;, where
PATH_TO_DATABASEis the location of one of the installed GeoIP2 databases, for example:
Now Flussonic will use the specified database to determine geolocation.
If the specified database is unavailable, Flussonic will use the database that was shipped with Flussonic.