Skip to content

Instantly share code, notes, and snippets.

@aerth
Last active March 21, 2016 20:00
Show Gist options
  • Save aerth/940a5578b4fd977c45ad to your computer and use it in GitHub Desktop.
Save aerth/940a5578b4fd977c45ad to your computer and use it in GitHub Desktop.
ufw block china (RGFW)
#!/bin/sh
cat <<XXX>>china-ip.txt
223.0.0.0/12
223.20.0.0/15
223.27.184.0/22
223.64.0.0/10
223.128.0.0/15
223.144.0.0/12
223.160.0.0/14
223.166.0.0/15
223.192.0.0/15
223.198.0.0/15
223.201.0.0/15
223.203.0.0/16
223.208.0.0/13
223.220.0.0/15
223.223.176.0/19
223.240.0.0/13
223.248.0.0/14
223.254.0.0/16
223.255.0.0/17
XXX
while read line; do sudo ufw deny from $line to any; done < china-ip.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment