Skip to content

Instantly share code, notes, and snippets.

@thepapanoob
Created July 11, 2017 08:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thepapanoob/be82b2b1d229635a8b2efc9ec8e5e339 to your computer and use it in GitHub Desktop.
Save thepapanoob/be82b2b1d229635a8b2efc9ec8e5e339 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Add new ipset List
ipset -N china hash:net
# Get the latest Chinese Zone File
wget -P . http://www.ipdeny.com/ipblocks/data/countries/cn.zone
sudo mv cn.zone /etc/zones/cn.zone
# Iterate all IP's and add them to the blocklist
for i in $(cat /etc/cn.zone ); do ipset -A china $i; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment