TCwho Posted May 29, 2005 Share Posted May 29, 2005 Hey everyone. I want to block users from a specific range due to them using a contact us form to send spam to owner. The IP range is : 213.255.248.0 - 213.255.248.127 Now I want to use .htaccess to block this range. I coverted the range to binary and got this: 11010101.11111111.11111000.00000000 11010101.11111111.11111000.11111110 ----------------------------------- 11111111.11111111.11111111.00000001 The section under the ----- is the portion where 1's are same and 0's are changes. One of the questions I had, when converting 127 is that = 11111110 ? And when converting 00000001 to decimal what is the value? ..because I wasnt to sure how to convert 00000001 to decimal I didnt use a netrange/netmask to block it but a CIDR of 24...so is this correct below: deny from 213.255.248.0/24 Thanks Drop_Shadow How Did You Hear About Us Email HTML Order Link ---- GMT -5:00 Link to comment Share on other sites More sharing options...
FalseDawn Posted May 29, 2005 Share Posted May 29, 2005 order allow,deny deny from 213.255.248 allow from all will block 213.255.248.0 to 213.255.248.255 Why are you messing with binary? And really, there's no need to try to block IPs on the last figure unless you want to block a _specific_ IP address. Spammers can easily mask their IP anyway, so this is unlikely to be of much use anyway. Link to comment Share on other sites More sharing options...
TCwho Posted May 29, 2005 Author Share Posted May 29, 2005 well I am trying to block a specific range...(which is the range of the internet cafe used) This particular guy/gal whatever isnt masking his ip address .... which lets not discuss to show people how... but I traced it back to the internet cafe he was using .. which is the range I have above.... ..but the CIDR of 24 I used is right tho...? Isnt it. Thanks Drop_Shadow How Did You Hear About Us Email HTML Order Link ---- GMT -5:00 Link to comment Share on other sites More sharing options...
FalseDawn Posted May 29, 2005 Share Posted May 29, 2005 What what I can gather, a CIDR block prefix of /24 corresponds to 256IP addresses, and one of /25 corresponds to 128IP addresses, so you would need /25, not /24. I still think you are complicating things unneccessarily. Link to comment Share on other sites More sharing options...
TCwho Posted May 29, 2005 Author Share Posted May 29, 2005 yeah your right, I change it to 213.255.248 . I just didnt want to block the range after the last ip address part of 127 since as far as I know, isnt related..... I did take it back Ol' School there for a moment huh! Drop_Shadow How Did You Hear About Us Email HTML Order Link ---- GMT -5:00 Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.