IP addresses to countries
- From: Troy Piggins <usenet-0707@xxxxxxxxx>
- Date: Mon, 30 Jul 2007 10:06:33 +1000
I have a file full of unique IP addresses, one per line, from
machines that I block access to my server. At present I use a
script to add each individual IP to an iptables ruleset.
I've collected over a hundred, and I am interested in the
statistics of what countries they are commonly from. I know I
could manually check each one but would prefer, obviously, to use
a simple script to do the job as the list grows.
What I would like the script to do is check each IP address, get
the IP block/range it belongs to along with what country it's
from. Would you use whois $IP_ADDR, grep 'inetnum' and
'country'? When I tried manually on a couple, I got "Unknown AS
number or IP network. Please upgrade this program."
Any ideas/pointers?
--
Troy Piggins | http://piggo.com/~troy
RLU#415538 ,-O (o- O
O ) //\ O
`-O V_/_ OOO
.
- Follow-Ups:
- Re: IP addresses to countries
- From: Tony Borras
- Re: IP addresses to countries
- Prev by Date: Re: Inheriting proper env for crontab
- Next by Date: Re: Random list of filenames
- Previous by thread: Random list of filenames
- Next by thread: Re: IP addresses to countries
- Index(es):
Relevant Pages
|