https://github.com/jmousqueton/linux-firewall-block-country
Script to block China netblocks on iptables
https://github.com/jmousqueton/linux-firewall-block-country
bash bash-script china firewall firewall-rules ipset ipset-rules iptables netblocks script
Last synced: 5 months ago
JSON representation
Script to block China netblocks on iptables
- Host: GitHub
- URL: https://github.com/jmousqueton/linux-firewall-block-country
- Owner: JMousqueton
- Created: 2022-04-24T13:26:11.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-04-24T13:45:25.000Z (about 3 years ago)
- Last Synced: 2025-01-07T20:15:26.012Z (6 months ago)
- Topics: bash, bash-script, china, firewall, firewall-rules, ipset, ipset-rules, iptables, netblocks, script
- Language: Shell
- Homepage:
- Size: 8.79 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Quick & Dirty script to block China netblocks with iptables 🔥 🇨🇳
## Usage
1. Copy [iptables.firewall.rules](/etc/iptables.firewall.rules) to /etc
> these rules only allow 80/TCP, 443/TCP and 22/TCP
2. Execute [block-china.sh](block-china.sh)
3. Add to crontab :```crontab -e```
```
0 5 * * * /etc/block-china.sh > /dev/null 2>&1
```you can check with the commande ```iptables -L```