Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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```