Forum Moderators: phranque

Message Too Old, No Replies

Block IP range?

         

keyplyr

8:57 am on Jun 4, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Seems like I'm always asking this same question. Sorry, do it so seldom I forget how.

Would this:

RewriteCond %{REMOTE_ADDR} ^64\.71\.1(2-9)(89¦01)\.

effectively block this range? Thanks.

64.71.128.0 - 64.71.191.255

keyplyr

7:19 pm on Jun 4, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



In addition to this range: 64.71.128.0 - 64.71.191.255
I also need to block this range: 65.19.134.0 - 65.19.134.31

Thanks

bobothecat

7:22 pm on Jun 4, 2005 (gmt 0)



Don't feel bad, I can't remember it either - glad you asked first :)

keyplyr

3:16 am on Jun 5, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



anyone?

keyplyr

5:49 am on Jun 5, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



This is what I came up with:

RewriteCond %{REMOTE_ADDR} ^64\.71\.1(2[89]¦[3-8][0-9]¦9[01])\. [OR]
RewriteCond %{REMOTE_ADDR} ^65\.19\.134\.(0¦[12][0-9]¦3[01])$ [OR]

Matt Probert

12:52 pm on Jun 5, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you can, use IPTABLES and block the IP range from the server, otherwise they will stil have accessed the server, and Apache will be slowing down checking *every* connection just to reject those few.

Matt

keyplyr

7:11 pm on Jun 5, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Thanks Matt but I'm hosted on a shared server.

encyclo

7:21 pm on Jun 5, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You'd be best using mod_access [httpd.apache.org] rather than mod_rewrite. It's much simpler:

Order Allow,Deny
Allow from all
Deny from 64.71.128/191
Deny from 65.19.134.0/31

(The above is untested and done from memory ;)

keyplyr

8:12 pm on Jun 5, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Thanks encyclo, however the way host is set up (load balanced apache server clusters using BSD) mod_access alters the log data, i.e. screws with the referrers. Don't ask me why.