GeoIP and ASN Data
Arkime can label the IP addresses in every session with a country, an ASN and an RIR, plus a region and city when the database you give it has them.
Those labels are what make searches like country.src == RU && asn.dst == *Amazon* work, and what the Map and the ASN graphs draw.
Arkime does not ship a geolocation database and does not download one for you.
You choose a vendor, put an MMDB file on every capture machine and point capture at it.
With no geo files at all Arkime runs fine, you just get no country, city or ASN fields.
Since 7.0.0 Arkime works out which vendor wrote the file and reads it accordingly, so you are no longer limited to MaxMind.
What Arkime Adds to a Session
For the source and destination of every session, Arkime stores a country, an ASN and an RIR, plus a region and city when the database has them.
Country, ASN and RIR are searchable, as country.src, asn.dst, rir.src and so on.
Region and city are stored and shown on the session detail page, but get no search expression.
The RIR is the odd one out, it comes from the IANA rirFile and not from a geo database at all.
Every other IP field gets a country, an ASN and an RIR too, but never a region or city.
Fields whose expression starts with ip. get country., asn. and rir. versions, so ip.dns gives you country.dns, asn.dns and rir.dns.
The rest get the suffix form instead, <field>.country, <field>.asn and <field>.rir.
capture does the lookup as it writes the session and stores the answer, so updating or replacing your database changes new sessions only.
Everything already in OpenSearch/Elasticsearch keeps the answer that was true when it was captured.
That is usually what you want for an investigation, but it does mean you cannot fix bad geo data after the fact.
Private addresses (RFC 1918 and friends) are in no vendor’s database, so your own hosts get no country and no ASN. See Your own networks below for fixing that.
Country, City and ASN Are Three Different Things
Vendors sell these as separate products, and the free tiers rarely include all of them, so it is worth being clear about what each one buys you.
- Country databases map an IP to a 2 letter country code. This is the one everybody gets right, because it mostly follows the regional registry allocations and BGP announcements. Accuracy is commonly quoted around 99%.
- City databases add a region/subdivision code, a city name, and usually a latitude, longitude and postal code that Arkime ignores. This is the part that is genuinely hard, is often wrong, and is where the paid products earn their money. City accuracy claims in the 60–80% range are normal, and “within 50km” is the usual yardstick.
- ASN databases map an IP to the autonomous system number and the organization that announces it. Like country, this comes from BGP and is reliable. It is frequently the most useful of the three in Arkime, because “which provider is this” answers more questions than “which city is this”.
Arkime reads exactly five values out of a geo database: the country code, the subdivision code, the city name, the AS number and the AS organization.
Anything else a vendor puts in the file — ISP name, domain, connection type, VPN/proxy flags, latitude, longitude, time zone — is ignored by capture.
So paying a vendor buys you better country/city/ASN data for Arkime, not more fields.
Free Databases
Every one of these works with Arkime 7. Only the three that use the MaxMind record layout also work with Arkime 6 and earlier, which has no vendor detection — see Arkime 6 and earlier.
| Vendor | Free MMDB files | Country | Region/City | ASN | Arkime 6 | Updated | Account needed | License |
|---|---|---|---|---|---|---|---|---|
| MaxMind GeoLite | GeoLite2-Country, GeoLite2-City, GeoLite2-ASN |
yes | yes, with the City file | yes, separate file | yes | City and Country Tuesday and Friday, ASN every weekday | yes, free account plus a license key | GeoLite EULA, attribution required, old copies must be deleted within 30 days |
| db-ip Lite | IP to Country Lite, IP to City Lite, IP to ASN Lite | yes | yes, with the City file | yes, separate file | yes | monthly | no | CC BY 4.0, attribution with a link back required |
| ipinfo Lite | ipinfo_lite.mmdb |
yes | no | yes, same file | no, 7.0.0+ | daily | yes, free signup | CC BY-SA 4.0 |
| GeoOpen (CIRCL) | GeoOpen-Country, GeoOpen-Country-ASN |
yes | no | yes with Country-ASN, same file | no, 7.0.0+ | irregular, roughly weekly | no | Open Data Commons Attribution |
| IP2Location LITE | DB1 country, DB11 country/region/city, ASN LITE | yes | yes, with DB11 | yes, separate file | yes | 1st and 15th of each month | free signup, or the no-signup mirror | CC BY-SA 4.0, attribution required |
A rough guide:
- No account, least effort — db-ip Lite City plus db-ip Lite ASN. Two files, a plain
curlto update, no key, and you get city data. - One file, no city data wanted — ipinfo Lite or GeoOpen Country-ASN. Country and ASN in a single file, so you only set geoFile.
- Best free city data — MaxMind GeoLite City plus GeoLite ASN, or IP2Location LITE DB11 plus ASN LITE. Both want an account.
- Fully open data — GeoOpen, which is generated from public BGP announcements by CIRCL and is country level only.
Arkime does not include or redistribute any of these files, so the attribution the licenses ask for is on whoever deploys them. If you put Arkime screenshots or exports in front of other people, read your vendor’s terms.
Paid Databases
All of these are drop-in replacements for the free file from the same vendor — point geoFile and geoASNFile at them and nothing else changes. Paying does not change which Arkime version can read the file, because the record layout is a property of the vendor, not of the tier.
| Vendor | Paid product | What it adds that Arkime can use | What it adds that Arkime ignores | Arkime 6 |
|---|---|---|---|---|
| MaxMind | GeoIP2 Country / City | noticeably better city and region accuracy, and a 1,000 per day download limit instead of GeoLite’s 30 | ISP, domain, connection type, user type, anonymous IP / VPN / Tor flags | yes |
| db-ip | db-ip full databases | more records, better accuracy, daily updates, no attribution requirement, support | ISP and organization products | yes |
| ipinfo | Core / Plus / Max | city level geolocation, which Lite does not have at all | privacy and VPN detection, company and carrier context | no, 7.0.0+ |
| IP2Location | commercial editions | city accuracy 80% versus 60%, >4M records versus >1M, full 1.2.3.4 resolution versus 1.2.3.x, daily updates |
usage type, mobile carrier, elevation, weather station, address type | yes, same layout as LITE |
| GeoOpen | none, it is open data only | — | — | no, 7.0.0+ |
For Arkime specifically the honest summary is: if you only search on country and ASN, the free files are fine. If you actually investigate on city and region, that is the one place paid data is clearly better.
Configuring It
Arkime 7 and later
Two settings, both semicolon separated lists of paths, and the first path that exists is the one used:
geoFile=/opt/arkime/etc/dbip-city-lite.mmdb
geoASNFile=/opt/arkime/etc/dbip-asn-lite.mmdb
Both have defaults that look for the usual MaxMind locations, so if you run geoipupdate you normally set neither.
Set a setting to a blank string to turn the feature off and silence the startup warning:
# I don't want geo data at all
geoFile=
geoASNFile=
See geoFile and geoASNFile for the full defaults.
How Arkime picks the layout
Vendors store the same facts under different keys inside the MMDB, so at load time capture reads the file’s database_type metadata and chooses the lookup paths:
database_type starts with |
Layout used | Notes |
|---|---|---|
ipinfo |
country_code, region_code, city, asn, as_name |
treated as a city database, and as carrying its own ASN data |
GeoOpen |
country.iso_code, and country.AutonomousSystemNumber / country.AutonomousSystemOrganization |
country level only; ASN data is used only when the type also contains ASN |
| anything else | country.iso_code, subdivisions.0.iso_code, city.names.en, and autonomous_system_number / autonomous_system_organization in the ASN file |
the MaxMind layout, which db-ip and IP2Location LITE also use |
Two consequences worth knowing:
- Region and city are only read when the country file’s
database_typecontainsCity. A Country-only file leaves them empty, which is correct, and so does any city database whose type string does not sayCity. IP2Location LITE DB11 reportsGeoLite2-City, so it works. - A geoASNFile wins over ASN data inside the geoFile. If you use ipinfo Lite or GeoOpen Country-ASN and a
GeoLite2-ASN.mmdbhappens to be lying around in one of the default geoASNFile paths, that stale file is what you will get. SetgeoASNFile=to a blank string when your geoFile already has the ASN data.
Reloading
capture watches the file it loaded and reloads it in place when it changes, so replacing an MMDB does not need a restart. You will see:
Loading new version of country file
Only the path that was found at startup is watched. If you later create a file that is earlier in the semicolon list, capture will not switch to it until you restart.
Arkime 6 and earlier
The settings were called geoLite2Country and geoLite2ASN. Both names are still accepted in 7.x when the new name is not set, so you do not have to change your config to upgrade.
Arkime 6 only knows the MaxMind layout, with no vendor detection, so three of the five vendors work on it:
- MaxMind, db-ip and IP2Location LITE work on 6.x, because all three write MaxMind style records. db-ip even says so in its own metadata, where the ASN file reports a
database_typeofDBIP-ASN-Lite (compat=GeoLite2-ASN), and bothDBIP-City-Liteand IP2Location’s DB11 containCity, so 6.x fills in region and city from them too. - ipinfo and GeoOpen files do not work before 7.0.0. They store the same facts under different keys, and without the vendor detection added in 7.0.0
capturelooks for keys that are not there and silently finds nothing.
Cont3xt
Cont3xt has its own MaxMind integration for on-demand lookups, configured with geoLite2Country and geoLite2ASN in its [Maxmind] or [cont3xt] section. Those settings were not renamed in 7.0.0.
It has none of the vendor detection that 7.0.0 added to capture, so it needs the MaxMind record layout just like Arkime 6 does: MaxMind, db-ip and IP2Location LITE files work, ipinfo and GeoOpen files do not.
The file still opens without an error, because the MMDB container format is the same for everyone, but Cont3xt reads fixed keys — country.iso_code, autonomous_system_number and autonomous_system_organization — so with a file that does not use them the country and ASN badges simply stay empty.
Keeping the Files Current
Every vendor requires or at least expects you to stay reasonably current, and MaxMind’s EULA requires deleting a database within 30 days of a new release.
/opt/arkime/bin/arkime_update_geo.sh, which is a good cron job on every capture node, does three things:
- downloads IANA’s
ipv4-address-space.csvto/opt/arkime/etc/for the rirFile setting - downloads Wireshark’s
manufto/opt/arkime/etc/oui.txtfor the ouiFile setting - runs
/usr/bin/geoipupdateif it is installed, which is MaxMind’s own updater
It does not fetch anything from db-ip, ipinfo, GeoOpen or IP2Location. For those, add your own cron job:
# db-ip Lite, monthly
curl -sSfL -o /opt/arkime/etc/dbip-city-lite.mmdb.gz \
https://download.db-ip.com/free/dbip-city-lite-$(date +%Y-%m).mmdb.gz
gunzip -f /opt/arkime/etc/dbip-city-lite.mmdb.gz
# GeoOpen, always the newest build
curl -sSfL -o /opt/arkime/etc/GeoOpen-Country-ASN.mmdb \
https://cra.circl.lu/opendata/geo-open/mmdb-country-asn/latest.mmdb
Write to a temporary file and move it into place, the way arkime_update_geo.sh does, so a failed download cannot leave a truncated MMDB behind.
Because capture reloads on change, that is all there is to it.
For MaxMind, set up geoipupdate once — see the FAQ entry for the account and license key steps.
RIR Data
The RIR fields do not come from a geo database at all.
They come from IANA’s IPv4 address space registry, configured with rirFile and refreshed by arkime_update_geo.sh.
Two things follow from how it works: it is resolved per /8, so it is as coarse as the original IANA allocation, and it is IPv4 only. IPv6 sessions have no RIR.
Your Own Networks
No database has your internal addresses, and some public ranges will be wrong for you.
The [override-ips] section fixes both, per CIDR, and takes priority over whatever the MMDB says:
[override-ips]
10.1.0.0/16=tag:ny-office;country:US;region:NY;city:New York;asn:AS0000 Our Datacenter
192.168.0.0/16=tag:internal;country:US
Anything you leave out still comes from the database, so setting only tag keeps the real country.
country, region, city, asn and rir are all overridable, and since 5.0.0 so is any other field expression.
Use overrideIpsFiles to keep these in separate files that reload without restarting capture.
Troubleshooting
WARNING - No Geo Country file could be loadedor the ASN equivalent- None of the paths in geoFile / geoASNFile exist. Check the path and that the file is readable by the user
capturedrops to. Set the setting to a blank string if you do not want geo data. - Country works, city and region are always empty
- You are using a Country-only database, or a file whose
database_typedoes not containCity. ipinfo Lite, GeoOpen and db-ip’s Country Lite have no city data at all. Switch to a City file. - ASN is wrong or stale while country looks right
- A leftover
GeoLite2-ASN.mmdbin one of the default geoASNFile paths is being used instead of the ASN data in your combined file. SetgeoASNFile=blank, or delete the old file. - Old sessions did not change after I updated the database
- Expected. Lookups happen once, when
capturewrites the session. Only new sessions use the new data. - Internal hosts have no country or ASN
- Expected, private address space is in nobody’s database. Use
[override-ips]. - Country is right but the Map looks wrong
- The Map draws from the country code only. Region and city are not plotted.