logo

How to start using GeoLite2(GeoIP) Database

About Geo2Lite

Since version 4.5.8 Roxy-WI allows to download and update GeoLite2 via the web panel.

GeoIP, MaxMind’s IP intelligence product, consists of several related products. GeoIP lets you discover information about a specific IP address. Maxmind provides web services, subscription-based downloadable databases, and free downloadable databases.

Databases

GeoLite2 databases are free IP geolocation databases comparable to, but less accurate than, MaxMind’s GeoIP2 databases. The GeoLite2 Country, City, and ASN databases are updated weekly, every Tuesday.

IP Geolocation Usage

IP geolocation is inherently imprecise. Locations are often near centers of the population. Any location provided by a GeoIP database should not be used to identify a particular address or household.
Use the Accuracy Radius as an indication of geolocation accuracy for the latitude and longitude coordinates Maxmind returns for an IP address. The actual location of the IP address is likely within the area defined by this radius and the latitude and longitude coordinates.

Go to TOP

Getting Licence Key

MaxMind provides access to GeoLite2 databases only for registered users. So, you need to get a license key. All the details are described in the instruction below.

First of all create an account here:

MaxMind sign up

when you have created your account, you will receive an email with further instructions:

MaxMind sign up

Follow the link to create a password:

MaxMind sign up

After finishing the registration you will be granted acess to your private cabinet:

MaxMind sign up

To download the database you need to get a license key. Go to "My Licence Key" section: Follow the link to create a password:

MaxMind sign up

Next:

MaxMind sign up

Next:

MaxMind sign up

The license key will be displayed on the screen. Copy and save it as it will not be shown anymore:

MaxMind sign up

Specify your key as the value of the maxmind_key parameter in your group settings:

MaxMind sign up

Go to TOP

Start to use GeoLite2 with Roxy-WI

Roxy-WI allows to use GeoLite2 via the web interface. Create a license key to start using it.

After you have created the Licence key and added it into the group settings you can start using GeoLite2 Database:

Select a server for uploading, Roxy-WI will define if GeoLite2 is already installed on it(in the black box), and press the "Install" button(in the green box).

Roxy-WI will download and format it from GeoIP to acceptable format for HAProxy service. Also Roxy-WI will separate divide a big file with IPs into many smaller files (each file for one country) e.g.: file AD.subnets consists of all IPs which used in Andorra.

Go to TOP

Updating GeoLite2 with Roxy-WI

Updating

MaxMind updates GeoLite2 databases every Tuesday, so it should be updated every week. Roxy-WI can do it! Just check "Updating" checkbox.

Go to TOP

Using GeoLite2 with HAProxy

How files with IPs for each continent can be used for creating ACLs:

    acl acl_AF src -f AF.txt
    acl acl_AN src -f AN.txt
    acl acl_AS src -f AS.txt
    acl acl_EU src -f EU.txt
    acl acl_NA src -f NA.txt
    acl acl_OC src -f OC.txt
    acl acl_SA src -f SA.txt
                

You may reject all connections from a certain continent (for Africa, for instance):

    http-request deny if !acl_AF
                

or address them to different backend servers:

    use_backend bk_af if acl_AN
                
Go to TOP

Was this article helpful?

Yes, thanks!
Not really
Go back