Skip to content

Instantly share code, notes, and snippets.

@Disassembler0
Created April 1, 2019 11:52
Show Gist options
  • Save Disassembler0/38c2c76e529649410f01f96d80588a3b to your computer and use it in GitHub Desktop.
Save Disassembler0/38c2c76e529649410f01f96d80588a3b to your computer and use it in GitHub Desktop.
ipset -F cz.zone
ipset -N cz.zone nethash
for IP in $(wget -O - http://www.ipdeny.com/ipblocks/data/countries/cz.zone)
do ipset -A cz.zone $IP
echo $IP
done
iptables -A INPUT -m set --match-set cz.zone src -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j DROP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment