CentOS 7のGeoIP Free Databaseの更新

Facebooktwittermail

先日、下記の記事を書きました。

CentOS 7のsshdをGeoIPを使用してアクセス制限する

そこで利用しているGeoIPのDatabaseの更新はどうするのか?
GeoLite2 Free Downloadable Databases
https://dev.maxmind.com/geoip/geoip2/geolite2/

Automatic Updates for GeoIP2 and GeoIP Legacy Databases
https://dev.maxmind.com/geoip/geoipupdate/

geoipupdateコマンドをcronで定期的に更新する方法が記載されていました。
geoipupdateコマンドが無い場合は下記のコマンドでインストールして下さい。

試しにdatabaseを更新してみます。
設定ファイルは/etc/GeoIP.confですが、無償ライセンスの場合はそのままで大丈夫でした。

CentOSの場合は/usr/share/GeoIP/が標準のDatabase保存場所になります。

さて、geoipupdateをcrondでスケジュール実行させるのですが、Databaseの更新が毎週火曜日との記載があったので念のために木曜日に実行するように設定しました。
https://dev.maxmind.com/geoip/geoip2/geolite2/

The GeoLite2 Country, City, and ASN databases are updated weekly, every Tuesday.

これで毎週更新されたDatabaseが利用できます。

最後に一定期間に何度も更新を掛けると制限されるようです。

Download Limits
MaxMind reserves the right to limit the number of downloads made within a limited period of time.

Leave a Reply