Welcome to WebmasterWorld Guest from 23.22.17.192

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Blocking IPs with subnet mask

in .htaccess

   
1:45 am on Apr 15, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Suppose the IP range is aa.bb.cc.224 - 255

In .htaccess, I want to deny this range. What is the subnet mask?

Deny from aa.bb.cc.224/255.255.255.31 ?
Deny from aa.bb.cc.31/255.255.255.224 ?

or something else? It's hard to test it. Right now I'm using
Deny from aa.bb.cc
but I don't want to deny from 0-223

3:15 am on Apr 15, 2002 (gmt 0)

WebmasterWorld Administrator brett_tabke is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



I don't believe there is a "range" operator other than the entire 256 ips in a c block.
3:51 am on Apr 15, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



SetEnvIf Remote_Addr "^aa.bb.cc.22[4-9]$" ban
SetEnvIf Remote_Addr "^aa.bb.cc.2[3-9][0¦4-9]$" ban

Place deny from env=ban within <limit></limit> tags.

This should ban every IP between aa.bb.cc.224 and aa.bb.cc.256

 

Featured Threads

Hot Threads This Week

Hot Threads This Month