GithubHelp home page GithubHelp logo

ilia-abolhasani / iran-geo-ip Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 1.0 663 KB

Create an MMDB database for Iranian IPs, integrating with V2Ray VPN for direct access.

Jupyter Notebook 100.00%
ip-ranges iran v2ray

iran-geo-ip's Introduction

Iran Geo IP Database

This repository contains a Python project that focuses on creating an MMDB (MaxMind DB) database for Iranian IP addresses. The purpose of this project is to generate a custom rule for direct access in the V2Ray VPN application.

Repository URL

https://github.com/Ilia-Abolhasani/iran-geo-ip

Project Overview

The main objective of this project is to create an MMDB database by extracting Iranian IP ranges from the ip2location website and converting them to CIDR (Classless Inter-Domain Routing) notation. The generated database can then be utilized in the V2Ray VPN application to add a custom rule for direct access.

File Structure

The repository consists of the following files and folders:

  • ./data: This folder contains the data files used for generating the MMDB database.
  • ./result: This folder stores the generated MMDB database file.
  • generate_by_eservices.ipynb: This Jupyter Notebook file is responsible for extracting Iranian IP ranges from eServices.
  • generate_by_ip2location.ipynb: This Jupyter Notebook file retrieves the Iranian IP range from the ip2location website, converts it to CIDR notation, and generates the MMDB dataset.
  • websites_urls_wildcard.ipynb: This Jupyter Notebook file generates a list of Iranian website URLs to be used as wildcards in the VPN settings.

Generating the MMDB Database

To create the MMDB database, follow these steps:

  1. Run the generate_by_ip2location.ipynb notebook.
  2. The notebook will fetch the Iranian IP range from the ip2location website and convert it to CIDR notation.
  3. The resulting data will be used to generate the MMDB dataset.
  4. The generated MMDB file will be saved in the ./result folder.

Installation

To install the required dependencies, follow these steps:

  1. Install the MaxMind-DB-Writer-python package by running the following command:

    pip install -U git+https://github.com/VimT/MaxMind-DB-Writer-python
    
  2. Install the maxminddb package by running the following command:

    pip install maxminddb
    
  3. Install the additional Python packages by running the following command:

    pip install netaddr ipaddress pandas tqdm

These commands will ensure that you have the necessary dependencies installed for generating and working with the MMDB database. The additional packages (netaddr, ipaddress, pandas, tqdm) are required for various functionalities in the project.

Make sure to run these commands in your Python environment or virtual environment before using the project.

Usage

Once you have the MMDB database file, you can incorporate it into the V2Ray VPN application to add a custom rule for direct access to Iranian IP addresses.

Acknowledgments

The project utilizes the ip2location website (https://lite.ip2location.com/iran-(islamic-republic-of)-ip-address-ranges?lang=en_US) for retrieving Iranian IP ranges.

License

This project is licensed under the MIT License. Feel free to modify and distribute it as per the terms of the license.

iran-geo-ip's People

Contributors

ilia-abolhasani avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

saeed860

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.