Code Monkey home page Code Monkey logo

geolite2xtables's Introduction

THIS PROJECT IS NOT BEING ACTIVELY MAINTAINED. PLEASE FIX YOUR PRODUCTION ISSUES IN YOUR OWN FORK.

THIS PROJECT HAS BEEN FIXED FOR ubuntu 18.04 with the instructions here

GeoLite2xtables

This script aims to create a traditional GeoIP-CSV database from GeoIP's GeoLite2 database files, for use with xtables-addons' xt_geoip module.

Upstream work on the original conversion scripts in xtables-addons is in progress as well:

https://sourceforge.net/p/xtables-addons/xtables-addons/ci/master/tree/geoip/

For conversion, it is required to download an additional file with country names from Geonames.

Whether or not this software violates any Maxmind license is unclear. Be sure to read and understand the disclaimer in the LICENSE.txt file before trying to use this software!

THIS IS NOT PRODUCTION SOFTWARE; BE SURE TO READ AND UNDERSTAND THE DISCLAIMER IN THE LICENSE.txt FILE!!!

Requirements

  • curl

  • unzip

  • Perl

  • Perl module NetAddr::IP

  • A valid geolite2 license from Maxmind

Traditional workflow for updating the GeoIP database for xt_geoip

/usr/lib/xtables-addons/xt_geoip_dl
/usr/lib/xtables-addons/xt_geoip_build -D /usr/share/xt_geoip *.csv

Workflow with conversion:

  • create geolite2.license with your correct license information
cd /usr/local/src/GeoLite2xtables/
./00_download_geolite2
./10_download_countryinfo
cat /tmp/GeoLite2-Country-Blocks-IPv{4,6}.csv |
	./20_convert_geolite2 /tmp/CountryInfo.txt > /usr/share/xt_geoip/GeoIP-legacy.csv
/usr/lib/xtables-addons/xt_geoip_build -D /usr/share/xt_geoip /usr/share/xt_geoip/GeoIP-legacy.csv

Known limitations

None, thanks to an insane speed fix by John Hood, github.com/cgull.

TODO

  • Use Text::CSV for parsing the input data.
  • Merge/adopt cgull's geoipnames feature.

geolite2xtables's People

Contributors

mschmitt avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.