1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How To Ban Traffic From A Certain Country By IP Range?

Discussion in 'Site & Server Administration' started by ORiN, Jul 14, 2006.

  1. #1
    I know cPanel has the IP Deny manager feature but it doesn't seem to work for IP ranges which I need to block out certain ranges that are using up my bandwidth and not generating any revenue for me. Please advise. :D
     
    ORiN, Jul 14, 2006 IP
  2. sreyas

    sreyas Well-Known Member

    Messages:
    128
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    108
    #2
    This could help you, please use this code in .htaccess First you will have to find the IP range

    
    <Directory /docroot>
            Order Allow,Deny
            Deny from 69.28.130.
            Allow from all
    </Directory>
    
    Code (markup):
     
    sreyas, Jul 15, 2006 IP
  3. ORiN

    ORiN Well-Known Member

    Messages:
    753
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    130
    #3
    Thanks a lot!
     
    ORiN, Jul 15, 2006 IP
  4. ORiN

    ORiN Well-Known Member

    Messages:
    753
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    130
    #4
    That's another question now. Is 'Deny from 69.28.' possible if I want to block a bigger range?
     
    ORiN, Jul 15, 2006 IP
  5. sreyas

    sreyas Well-Known Member

    Messages:
    128
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    108
    #5
    just use 69.:)
     
    sreyas, Jul 15, 2006 IP
  6. nddb

    nddb Peon

    Messages:
    803
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    0
    #6
    If you know CIDR notation, I believe you can also do, 81.0.0.0/8 or 69.28.0.0/16

    or if you want to block just a /24 (256 IPs, maybe a dialup pool or something) X.X.X.0/24.

    Also, before you go blocking any huge ranges, I would check www.arin.net, if it's from inside your country, or your target audience is there, you might want to try smaller ranges. For instance, if you run a site geared towards europeans, you're not gonna wanna block huge RIPE blocks, but you might not care about APNIC blocks.
     
    nddb, Jul 17, 2006 IP
  7. sreyas

    sreyas Well-Known Member

    Messages:
    128
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    108
    #7
    Let me share you a secret with you. Our hosting company has been blocking all the IP ranges from china. Not sure why they were doing this. And it continued to be like this till one of our usual customer I think he was from US went there for business purpose and was not able to access mail using his Laptop. He submitted a support ticket and then on the IPs(specific IP) was removed from apf.

    I have question, is this china so much dangerous?? not sure why this happening.

    Regards
     
    sreyas, Jul 17, 2006 IP
  8. klown

    klown Peon

    Messages:
    2,093
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    0
    #8
    are you sure it was your hosting company and not the chinese government doing the blocking? I know some big hosting companies such as powweb .com will put thousands of sites on one ip address then one of them says something that the chinese gov's keyword blockers block, it blocks the whole IP from china.

    Of course if your hosting company does block from china it could be because im pretty sure a huge amount of spam comes from here.
     
    klown, Jul 17, 2006 IP
  9. Bushranger

    Bushranger Notable Member

    Messages:
    2,841
    Likes Received:
    257
    Best Answers:
    0
    Trophy Points:
    200
    #9
    I have hackers i've traced to russia and china, what's the easiest way to block both countries entirely?
     
    Bushranger, Feb 4, 2008 IP
  10. FHost

    FHost Peon

    Messages:
    141
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    The best way is blocking with a firewall, if you are running linux, i will suggest CSF or APF
     
    FHost, Feb 4, 2008 IP
  11. Bushranger

    Bushranger Notable Member

    Messages:
    2,841
    Likes Received:
    257
    Best Answers:
    0
    Trophy Points:
    200
    #11
    Thanks for trying FHost but I meant on my website.

    Hard disk is very secure, unfortunately I don't have the same security provided by the webhost, that's why I want to ban whole countries. Main priority is a local cinemas site I administer, they don't need visitors from other countries anyway.
     
    Bushranger, Feb 5, 2008 IP
  12. FHost

    FHost Peon

    Messages:
    141
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    Have you already request that to your hosting provider? They can block a specific range of ip's to reach only your website.
     
    FHost, Feb 5, 2008 IP
  13. TrafficSales

    TrafficSales Peon

    Messages:
    1,095
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #13
    What's the best way to ban all of china using a linux server with cpanel / whm?
    If anyone knows please pm me the answer. Thanks!@
     
    TrafficSales, May 23, 2008 IP
  14. phplife

    phplife Peon

    Messages:
    36
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #14
    Just to let you know, this will block the less knowledgeable user, but if people use TOR (a proxy network) or any anonymous proxy servers you won't be able to ban them.

    phplife
     
    phplife, May 23, 2008 IP
    Bushranger likes this.
  15. axa

    axa Active Member

    Messages:
    915
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    60
    #15
    anyone knows where to see ip list/range from asian countries?
     
    axa, Jan 30, 2009 IP
  16. MLHmptn

    MLHmptn Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #16
    If your running linux ... CSF or APF...CSF preferably as it has a whole country block feature whereas APF does not.

    Get CSF here: http://www.configserver.com/cp/csf.html
    Get APF here: http://rfxnetworks.com/apf.php


    Also you may want to visit: http://www.ipdeny.com/ipblocks/ for Country Codes to use in CSF configuration. The use the country code in the configuration variable CC_DENY of CSF.

    HTH!
     
    MLHmptn, Feb 11, 2009 IP
  17. Jupitersin

    Jupitersin Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #17
    Beethink ip blocker blocks country ip with htaccess file. It supports ip lists and ip ranges. Beethink ip blocker works as a Windows service.
     
    Jupitersin, Mar 15, 2010 IP
  18. wannabem

    wannabem Peon

    Messages:
    42
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #18
    wannabem, Jan 11, 2011 IP
  19. Virender Kumar

    Virender Kumar Greenhorn

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #19
    This plugin helps you to block users from different countries based on their ip address. This is open source application based on Joomla.
    Only need to download and install plugin from this website -
    http://www.codefire.org/cfblockcountries.html


     
    Virender Kumar, Feb 25, 2014 IP