Answer the question
In order to leave comments, you need to log in
iptables geo filter rules?
Help solve the problem, block all countries except one, using the ip range! xtables I already tried it skips packets.
OS: Centos 6.7
IPTABLES: 1.4.7
Answer the question
In order to leave comments, you need to log in
If you do not drive with geoip modules, then you need ipset
ipset -N %country% hash:net
wget -P . http://www.ipdeny.com/ipblocks/data/countries/%country%.zone
for i in $(cat /etc/%country%.zone ); do ipset -A %country% $i; done
iptables -P INPUT DROP
iptables -A INPUT -p tcp -m set --match-set %country% src -j ACCEPT
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question