Appearance
IP location (GeoIP)
Bitstream finds the country and the provider (ISP, ASN) of every connection. This drives the flags next to IPs, the dashboard map, blocks by country or ASN, forced countries on lines and node routing by country.
It works out of the box. The installer downloads the free DB-IP Lite databases, and the panel updates them every week. You do not need an account.
Check that it works
Open Settings > IP location.
- Working means both databases are loaded.
- Country database and Provider database (ASN) show the date the provider built each file.
- Test an IP shows what the panel finds for any address. Try
8.8.8.8: it should say United States, Google LLC, AS15169.
A new database applies to new connections. Viewers already watching keep the country they had until they reconnect.
Update now
Click Update now. The download runs in the background and takes less than a minute. The page tells you when it is done.
If it fails, the panel keeps the previous database and says why, in plain words:
| Message | What to do |
|---|---|
| The download did not work | The server cannot reach the provider. Check the internet access and the firewall for outgoing HTTPS. |
| MaxMind refused the account ID or license key | Check both values in your MaxMind account and save them again. |
| The provider has not published this month's file yet | Wait a few hours. The panel also tries last month's file. |
| The downloaded file was damaged | Nothing to do. The file was thrown away and the panel tries again later. |
| Could not save the file on the server | Check free disk space and that bs-control can write its data folder. |
After a failure the panel tries again on its own after 6 hours. After a success it waits a week.
Use MaxMind GeoLite2 instead
DB-IP Lite is good for countries. Some owners prefer MaxMind GeoLite2. Bitstream never ships MaxMind files, so you need your own free account.
- Create an account at maxmind.com.
- In your account page, open Manage license keys and create a key.
- In the panel, open Settings > IP location, choose MaxMind GeoLite2, and type your account ID and license key.
- Click Save changes. The panel downloads the databases right away.
The license key is stored encrypted and is never shown again.
Attribution
DB-IP Lite is licensed under CC BY 4.0. The panel shows "IP geolocation by DB-IP" on the IP location page while DB-IP data is in use. Keep it if you build your own pages on top of this data.
Where the files live
The files are country.mmdb and asn.mmdb in geoip/ inside the control data folder (/opt/bitstream/data/control/geoip with the installer). You can point to other files with BS_GEOIP_COUNTRY_DB and BS_GEOIP_ASN_DB (see Configuration). The updater replaces whatever files those settings point to.
Files are replaced in one step and the panel switches to them without a restart.
Automate it
bash
# status
curl -s $PANEL/geoip -H "Authorization: Bearer $TOKEN"
# update now (202, poll GET /geoip until "updating" is false)
curl -s -X POST $PANEL/geoip/update -H "Authorization: Bearer $TOKEN"
# switch to MaxMind
curl -s -X PATCH $PANEL/geoip -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
-d '{"provider": "maxmind", "maxmind_account_id": "123456", "maxmind_license_key": "<key>"}'
# test an IP
curl -s "$PANEL/geoip/lookup?ip=8.8.8.8" -H "Authorization: Bearer $TOKEN"