.gitignore | ||
add_ipset | ||
change_ip_block | ||
LICENSE | ||
README.md | ||
toggle_block | ||
whitelist_us |
IPSet and iptables Country Blocker
This repository contains a bash tool that utilizes ipset and iptables to block access from specific countries to your server. The tool is designed to improve server security by restricting access to IP addresses associated with countries you specify.
Features
- Utilizes ipset and iptables to block incoming traffic from specified countries.
- Multi-threaded implementation for improved performance.
- Simple installation and setup process.
Requirements
To use this tool, you need to ensure the following dependencies are installed on your system:
- ipset
- iptables
Installation
- Clone this repository to your desired location:
git clone https://gitea.tofasthacker.ddnsfree.com/tofasthacker/ip_block.git
- Change into the repository directory:
cd ip_block
- Make the main script executable:
chmod +x whitelist_us
chmod +x add_ipset
chmod +x toggle_block
- Run the tool:
sudo ./whitelist_us
Disclaimer
This tool aims to provide an additional layer of security by blocking access from specific countries. However, it is important to note that IP geolocation is not always accurate, and IP addresses can be easily spoofed or routed through other countries. Therefore, this tool should be used as part of a comprehensive security strategy and not as the sole means of protection.
Please use this tool responsibly and adhere to the laws and regulations of your jurisdiction.
License
This project is licensed under the MIT License. Feel free to use, modify, and distribute the code in accordance with the terms of the license.