Results 1 to 9 of 9
  1. #1
    Join Date
    Apr 2006
    Posts
    269

    Blocking a city from accessing a site??

    I need to block a city from accessing a site. Is this really possible? I have a client who insists they have seen it done, but I cannot find a way to find IP address ranges from just a certain city (I don't even think that exists?)

    On the other hand, how does Google Analytics and other places know which cities visitors are coming from? So in that regard I guess maybe it is possible?

    Any help would be great. Thanks!

  2. #2
    Join Date
    Apr 2005
    Location
    Cochin
    Posts
    2,446
    Check this out for learning how your request is handled.

    http://www.ip2location.com/

    If you are using iptables,

    blocking entire subnet

    # iptables -A INPUT -s 192.168.100.0/24 -j DROP

    blocking a range of ip's within a subnet:

    # iptables -I INPUT -m iprange --src-range 192.168.1.10-192.168.1.13 -j DROP

    Sam
    Supportlobby.com - Expertise in Windows/Linux server support, IaaS and PaaS Management
    Spiralbean.com - Custom Software Development
    Email: exec @ activelobby.net | Skype: unni_active

  3. #3
    Join Date
    Apr 2006
    Posts
    269
    So I would need to purchase this software? Are there any free alternatives?

  4. #4
    Join Date
    Apr 2005
    Location
    Cochin
    Posts
    2,446
    try a google search, you might find more. But as far as i know, this is one of the best available
    Sam
    Supportlobby.com - Expertise in Windows/Linux server support, IaaS and PaaS Management
    Spiralbean.com - Custom Software Development
    Email: exec @ activelobby.net | Skype: unni_active

  5. #5
    Join Date
    Apr 2000
    Location
    California
    Posts
    3,051
    This is not possible. While you can use existing tools/scripts to try and get some decent results, there's no way to know by the visitor's IP if they are in a specific city or not, and unless the way TCP/IP works some day, or unless there's a real-time IP database that's very accurate for all of the IPs in existence that you can query, there will never be a workable method. Still, you can have some success to where it might be workable enough for the purpose.

  6. #6
    Join Date
    Nov 2005
    Posts
    352
    Due to the way different ISPs handle their routing, Internet connections, and whois/reverse DNS entries, the closest you can guarantee would usually be the state the visitor is in. You may get better results with some of the largest ISPs (they are more likely to have proper reverse DNS entries set up), but some smaller providers might not provide any information other than where their headquarters is located. You may also wish to look into <A HREF="http://www.maxmind.com/app/ip-locate">GeoIP</A>, however it is not free.

  7. #7
    Join Date
    Nov 2007
    Location
    Earth
    Posts
    289
    http://www.caida.org/tools/utilities/netgeo/

    It contains database and collection of Perl scripts used to map IP addresses and AS numbers to geographical locations.

  8. #8
    Join Date
    Nov 2001
    Location
    Ann Arbor, MI
    Posts
    2,978
    I think this could be done by policy and policy enforcement through address verification. However, it would have almost as many holes as doing some GEO IP address thing.
    -Mark Adams
    www.bitserve.com - Secure Michigan web hosting for your business.
    Only host still offering a full money back uptime guarantee and prorated refunds.
    Offering advanced server management and security incident response!

  9. #9
    Join Date
    Apr 2005
    Location
    Cochin
    Posts
    2,446
    if he is planning to block 1000 Ip's its going to be tough if he plans to implement it after policy verification. And as far as i know the ipcountry stuff works good enough and its used to by programmers around the globe to implement their applications / websites. Ofcourse all these things has its own margin of errors
    Sam
    Supportlobby.com - Expertise in Windows/Linux server support, IaaS and PaaS Management
    Spiralbean.com - Custom Software Development
    Email: exec @ activelobby.net | Skype: unni_active

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •