Giter Club home page Giter Club logo

country-ip-blocks's Introduction

Country-IP-Blocks

GitHub Build Status

Generate latest country IP ranges in CIDR notation

How it works

The shell script generate.sh will download latest RIR statistics files (RIR statistics exchange format) form the following five Regional Internet Registries (RIRs).

rir-map.svg

URLs:

https://ftp.apnic.net/stats/apnic/delegated-apnic-latest
https://ftp.arin.net/pub/stats/arin/delegated-arin-extended-latest
https://ftp.ripe.net/ripe/stats/delegated-ripencc-latest
https://ftp.afrinic.net/pub/stats/afrinic/delegated-afrinic-latest
https://ftp.lacnic.net/pub/stats/lacnic/delegated-lacnic-latest

It then grab entries form files above. Generate country_code.txt. Convert IP ranges to CIDR notation. Generate IP files for each country.

Example

Generate Japan IPv4 ranges from APNIC and save to JP_IPv4.txt.

curl -sL https://ftp.apnic.net/stats/apnic/delegated-apnic-latest | \
grep "apnic|JP|ipv4" | \
awk -F '|' '{ printf("%s/%d\n", $4, 32-log($5)/log(2)) }' | \
tee JP_IPv4.txt

Usage

This will generate all countries and save IP files to your current directory.

curl -sL https://github.com/HackingGate/Country-IP-Blocks/raw/master/generate.sh | sh

Country code is under ISO 3166-2 standard.

GitHub Pages

The following files are hosted on GitHub Pages.

  • Mirror files of delegated-*-latest
  • country_code.txt
  • Country IP Block files

Available at https://hackinggate.github.io/Country-IP-Blocks/

and auto updates by Travis CI everyday.

IP change history

Since this project use git.

You can view IP changes from gh-pages branch.

Such as compare files between git commits to see when and what entries are added or deleted.

country-ip-blocks's People

Contributors

hackinggate avatar

Watchers

James Cloos 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.