Got IP zones from the internet:

gunzip -d all-zones.tar.gz ; tar -xvf all-zones.tar

Then with ipset

ipset create onlyita hash:net hashsize 64000
while read ip; do echo $ip ; done <


iptables -N countryfilter
iptables -A INPUT -i eth0 -p tcp -m state --state NEW -j countryfilter
iptables -A countryfilter -m set --set onlyita src -j RETURN
iptables -A countryfilter -j DROP

Leave a Reply

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