Quantcast
Channel: Forums | InterWorx CP
Viewing all articles
Browse latest Browse all 900

Geo Block IPs via APF or iptables?

$
0
0
New to Interworx and just deployed our first server with it.

I want to be able to apply the following script (or something very close to it) to block unwanted countries from spamming/hacking etc.

Code:

ipset -N geoblock nethash
for IP in $(wget -O – http://www.ipdeny.com/ipblocks/data/countries/{cn,kr,pk,tw,sg,hk,pe}.zone)
do
ipset -A geoblock $IP
done
 Matching against the IPSet in IPTables:
 iptables -A INPUT -m set –set geoblock src -j DROP

What file would I apply this to? I am not sure what firewall config files Interworx is using so I want to make sure I am applying this to the correct file.

Thank you

Viewing all articles
Browse latest Browse all 900

Trending Articles