How can I easily get the IP address blocks for a particular state or city within the US?
I was thinking that I could plug that into my iptables firewall to restrict traffic.
How can I easily get the IP address blocks for a particular state or city within the US?
I was thinking that I could plug that into my iptables firewall to restrict traffic.
this is the service that I have used for that: http://www.maxmind.com/app/javascript_city
ips are not allocated based on state/city etc.
A lot of IPs are allocated by state and town or neighborhood. If you use any of the free IP lookup services you will see that this is so. You can also add code to your website to block access to any range of IP addresses that you want to block.
The only remaining task is to get a list of IP addresses by city or state. There have to be such lists, otherwise all those free IP lookup services would not work.