Skip to content

nbutkowski/py-ip-lookup-tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Py IP Lookup Tool

Overview

Py IP Lookup Tool is a Python-based command-line application for performing IP address lookups. It provides functionalities to check whether an IP belongs to a specific CIDR block and retrieve related network details.

Features

  • Lookup IP addresses against predefined CIDR blocks.
  • Read and write IP data from CSV files.
  • Easy integration into scripts for automated network analysis.

Installation

Clone the Repository

git clone https://github.com/nbutkowski/py-ip-lookup-tool.git
cd py-ip-lookup-tool

Create a Virtual Environment

source venv/bin/activate  # macOS/Linux
venv\Scripts\activate      # Windows

Install Dependencies

pip install -r requirements.txt

Usage

Running the CLI Tool to check a single IP against a network

❯ python cli.py network-lookup 10.0.0.1 10.0.0.0/24
10.0.0.1 is in 10.0.0.0/24
❯ python cli.py network-lookup 10.0.0.1 10.0.1.0/24
10.0.0.1 is not in 10.0.1.0/24

Bulk lookup

Reads in 2 files (see /in for examples) and outputs a third file where the list are joined.

python cli.py bulk-network-lookup data/in/hostname-ip-list.csv data/in/networkname-block-list.csv

Running Tests

TBD

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages