This project provides a Python script to process IP ranges from various Regional Internet Registries (RIRs). It allows you to fetch and display IP Prefixes (IPv4, IPv6) and, optionally, organization information associated with these IP ranges. The script supports multiple RIRs, including RIPE NCC, AFRINIC, APNIC, LACNIC, and ARIN. This project is useful for network administrators, researchers, and IT professionals who need to analyze and manage IP address allocations across different regions.
To get started with the project, follow these steps:
git clone https://github.com/miladafshari/RIR-IP-Info.git
cd RIR-IP-Info
sudo make depends
make install
Run the Script: Execute the Python script from the command line:
rir-ip-info -h
This command retrieves the allocated IPv4 and IPv6 prefixes for Iran (IR) and Oman (OM) from the RIPE NCC database, displaying their network names and status.
rir-ip-info -r ripe -c ir om -t allocated -v 4 6 -o netname status
The script will accept the following arguments:
-r
/--rir
: Enter the Regional Internet Registry (e.g., RIPE, AFRINIC, APNIC, LACNIC, ARIN).
-c
/--country_code
Enter the country code (e.g., IR for Iran).
-t
/--prefix_type
Enter the type of prefix (Allocated/Assigned).
-v
/--ip_version
Enter the IP version (4/6).
-o
/--org_info
Choose whether to fetch organization information (e.g., netname, status).
-p
/--progress
Choose whether to display progress bar while fetching information.
Note: You can pass mutiple values to -r
, -c
, -t
, -v
and -o
.
The results will be saved to a file named according to the format:
results_{timestamp}.txt
Any PR(s) are welcomed.