| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
A powerful bash-based tool for managing iptables rules to block IP addresses by country using Regional Internet Registry (RIR) data. IPDroper allows you to easily block entire countries' IP ranges from accessing your Linux system.
Two versions available:
For Japanese README is here
IPDroper is a comprehensive bash script suite that simplifies the process of blocking IP addresses by country using iptables on Linux systems. It leverages data from Regional Internet Registries (RIRs) to automatically generate and manage iptables rules for blocking entire country IP ranges.
The tool supports all major RIRs:
| Feature | iptable Version | ipset Version |
|---|---|---|
| Rule Count | Thousands to tens of thousands | 1 (+ IPs in ipset) |
| Lookup Speed | Linear search | Hash-based search |
| Memory Usage | High | Low |
| Update Speed | Slow | Fast |
| Management | Complex | Simple |
Clone the repository:
git clone https://github.com/yourusername/IPDroper.git
cd IPDroperMake scripts executable:
chmod +x setup.sh
chmod +x scripts/*.shRun the setup script:
./setup.shClone the repository:
git clone https://github.com/yourusername/IPDroper.git
cd IPDroperMake scripts executable:
chmod +x *.sh
chmod +x scripts/*.shInstall ipset (first time only):
sudo ./install_ipset.shStart IPDroper:
sudo ./setup_ipset.shRun the main setup script:
sudo ./setup.shSelect an option from the menu:
Run the ipset setup script:
sudo ./setup_ipset.shSelect an option from the menu:
Example:
# Traditional version
sudo ./scripts/iptablesConfiguration.sh
# Select: 1 (APNIC)
# Enter country code: CN
# ipset version
sudo ./setup_ipset.sh
# Select: 1 (Add country block)
# Select RIR: 1 (APNIC)
# Enter country code: CNIPDroper/
├── README.md # This file
├── setup.sh # Traditional version main menu
├── setup_ipset.sh # ipset version main menu
├── install_ipset.sh # ipset installation script
├── README_ipset.md # Detailed ipset version documentation
└── scripts/
├── iptablesConfiguration.sh # Add country blocks
├── iptablesRemove.sh # Remove country blocks
└── iptablesList.sh # View current rules
1. Permission Denied
# Ensure you have sudo privileges
sudo ./setup.sh
# or for ipset version
sudo ./setup_ipset.sh2. iptables not found
# Install iptables (Ubuntu/Debian)
sudo apt-get install iptables
# Install iptables (CentOS/RHEL)
sudo yum install iptables3. ipset not found (for ipset version)
# Run the installation script
sudo ./install_ipset.sh4. curl not found
# Install curl (Ubuntu/Debian)
sudo apt-get install curl
# Install curl (CentOS/RHEL)
sudo yum install curl5. Invalid country code
6. Network connectivity issues
To see detailed output, you can run scripts directly:
# Traditional version
sudo bash -x ./scripts/iptablesConfiguration.sh
# ipset version
sudo bash -x ./setup_ipset.shContributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License - see the LICENSE file for details.
Warning: This tool modifies iptables rules and can affect network connectivity. Always test in a safe environment first and ensure you have proper backups of your iptables configuration.
Note: IPDroper is designed for educational and security purposes. Please ensure compliance with local laws and regulations when using this tool.
| Back | FazBrowse Home | New Git URL |