Geo-Block with ufw in Ubuntu 14.04

Quickly and Easily block ip addresses in bulk using ufw.
This is helpful to block heavy spam countries.

create a text file with CIDR format ip addresses

I recommend the list from wizcrafts.net or ip2location.com

run ./ufwblock.sh china.txt to block all ip adresses from file
run ./ufwunblock.sh china.txt to unblock

Leave a Reply

Your email address will not be published. Required fields are marked *