Forum Moderators: open

Message Too Old, No Replies

Banning APNIC

What would be the reprocutions

         

twist

8:06 am on Dec 21, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



My error log constantly fills up with addresses starting with "218." or the APNIC IP's. So I just banned "218." in htaccess. Should I go more specific and only ban ranges of trouble places?

Also, is their a way to ban a IP range without listing each one? For example, if I wanted to ban "192.1.1" through "192.1.255" in htaccess, is their a shorthand way to do this?

wilderness

2:04 pm on Dec 22, 2005 (gmt 0)

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



My error log constantly fills up with addresses starting with "218." or the APNIC IP's. So I just banned "218." in htaccess. Should I go more specific and only ban ranges of trouble places?

It depends if you feel (as the webmaster) that you stand to gain visitors and traffic from the other 218 ranges?


Also, is their a way to ban a IP range without listing each one? For example, if I wanted to ban "192.1.1" through "192.1.255" in htaccess, is their a shorthand way to do this?

This may help?
[webmasterworld.com...]

You may deny IP ranges to individual Class'es (A, B, or C)
wiith either

deny from 192.1. keep_out [or whatever term you use]
or
RewriteCond %{REMOTE_ADDR} ^192\.1\. [note if you have multiple lines this will likley require an "[OR]" flag]

In both of the above instances the 192.1.0-255.0-255 are denied.

twist

8:48 pm on Dec 22, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Also, is their a way to ban a IP range without listing each one? For example, if I wanted to ban "192.1.1" through "192.1.255" in htaccess, is their a shorthand way to do this?

I apologize, I meant "192.1.50" through "192.1.80"

without listing them like,

deny from 192.1.50
deny from 192.1.51
deny from 192.1.52
...

*EDIT* nevermind, I see it in your link

wilderness

8:55 pm on Dec 22, 2005 (gmt 0)

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



RewriteCond %{REMOTE_ADDR} ^192\.1\.(5[0-9]¦[67][0-9]¦80)\.

Please note that this forum breaks the pipe sybmols and these require correction.

bull

7:50 am on Jan 7, 2006 (gmt 0)

10+ Year Member



Yes, use deny with a CIDR range. For example, to deny 1.2.3.0 to 1.2.3.32, use "deny from 1.2.3.0/27"

To convert IP ranges to CIDR, you may use a tool like IPRange2CIDR ( [kgsoft.com...] )