Skip to content

woodger/ipcc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IPCC — Aggregated Country CIDR Generator

License Python Version

IPCC is a program for generating aggregated CIDR blocks by country based on official data from Regional Internet Registries (RIRs).

It supports IPv4 and IPv6 and can automatically merge adjacent networks.

Overview

  • Generates CIDR blocks by country (ISO 3166-1 alpha-2)

  • Supports IPv4 and IPv6

  • Automatically collapses adjacent networks (collapse)

  • Uses RIR data:

    • RIPE NCC
    • ARIN
    • APNIC
    • LACNIC
    • AFRINIC

Architecture

.
├── app
│   ├── __init__.py
│   ├── args.py      # CLI arguments
│   └── ipcc.py      # programm
├── tests
│   ├── test_ipcc.py
│   └── test_args.py
├── pyproject.toml
└── README.md

Usage

Generate USA IPv4:

./ipcc --country US --output ~/us.zone

The program will download RIR data, select networks of the specified country, merge adjacent CIDRs, and save the result to a file.

Testing

To run tests, use pytest:

pytest

Все тесты проходят, что гарантирует корректность парсинга и объединения сетей.

CLI Reference

Option Description Default
--country ISO country code RU
--ipv6 Use IPv6 false
--output Output file name <country>.zone

Output Format

Plain text CIDR list:

5.8.0.0/13
5.16.0.0/12
31.128.0.0/10

License

MIT License

About

Aggregated Country CIDR Generator

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages