Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: about 1 month 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 (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-04-24T13:45:25.000Z (almost 3 years ago)
- Last Synced: 2024-11-10T14:35:36.167Z (3 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```