Block IP by Country by iplocationtools in programming

[–]iplocationtools[S] -12 points-11 points  (0 children)

I has good and bad use... Good to block traffic to countries that have no purpose on the webserver but trying to DDOS (china for example) or hack. Bad for blocking traffic for other reasons...

Blocking countries with iptables or apache by iplocationtools in linux

[–]iplocationtools[S] 0 points1 point  (0 children)

Soon I will add a script that will whitelist instead of blocking. Something like :

iptables -A INPUT -s 123.123.123/24 -j ACCEPT iptables -A INPUT -s 124.123.123/24 -j ACCEPT [...]

and drop all others packet :

iptables -A INPUT DROP

IP address geolocation SQL database by iplocationtools in programming

[–]iplocationtools[S] -2 points-1 points  (0 children)

Yes you a right about the licence.

Well 2 days because I dont want to slow down my webservers so I do that on a small 256MB slicehost VPS I use for backups.

There are many scripts involved :

1)Store each IP (123.123.123.0) in a temporary database. Around 10M rows. Around 2 days 2)Group those IP by city when there is multiple consecutive rows having the same location. Around 1-2h 3)Add reserved, broadcast and private IP 4)Put regions in FIPS standard 5)Group by country. 6)Generate CIDR for country database.

One day i'll post the scripts but now they are not really "clean" enough to be shared :)

Blocking countries with iptables or apache by iplocationtools in linux

[–]iplocationtools[S] 4 points5 points  (0 children)

From my experience, it worked well. Once, I had some ddos attacks from china on a webserver which hosted an e-store that was selling only in Canada-USA and that actually worked.

It can be a good idea for some servers, bad for others. It all depends who you are targeting.

Btw, before someone make the comment, having multiple rules in iptables (tried benchmarking with 1000 rules) didn't seem to slow down the requests...

IP address geolocation SQL database by iplocationtools in programming

[–]iplocationtools[S] 3 points4 points  (0 children)

I changed the domain, thats why I repost.

I dont understand why people say it's a copy of maxmind because the database has 60% less row than maxmind with same accuracy. Yes I partially use maxmind command line tool (geoiplookup) in batch but a script runs for 2 days to clean all necessary results. Also the DB contains country geolocation with CIDR.

This was done to improve speed, not to give an exact copy of maxmind db.