Forum Moderators: phranque

Message Too Old, No Replies

Banning I.P. Help -

How to ban first part of an i.p.

         

kryptonsite

11:47 am on Apr 8, 2005 (gmt 0)

10+ Year Member



Hey,
I have this wierdo who keeps visiting my site and whom I want to ban his i.p. I currently use .htaccess to ban him but his i.p. keeps on changing. The first part of his i.p. is always, lets say "12."
Is it possible for me to ban any ip starting with "12." on htacess or any other way?
Please help. Thank you very much.

- Steve

idoc

2:03 pm on Apr 8, 2005 (gmt 0)

10+ Year Member



First, don't ban 12. that range belongs to att... it is too broad and you will lose alot of friendly traffic. Take the ip's you log for this visitor to arin*net and do a lookup. See who owns that block where the ip's are coming from then if you feel you need to protect your site from that providers range... ban the providers cidr net block. e.g. 12.*.*.0/27 ...whatever it is at arin. Look in the apache forum for lots of expert advice on writing .htaccess files... But, something like this:

<Limit GET POST >
order allow,deny
allow from all
deny from 12.*.*.*/*
</Limit>

You write this with a text editor name it .htaccess and upload it to the root of the website you want to protect. If you have access to apache config, or hosts.deny you can alternatively do it there.

kryptonsite

2:51 pm on Apr 8, 2005 (gmt 0)

10+ Year Member



thanks for the info was i supposed to get the number that was wrritten in CIDR: and pasted it as deny from **.*0.0.0/*? I also just need to test it to see if I'm doing it right but I dont know how. Any ideas?

kryptonsite

2:57 pm on Apr 8, 2005 (gmt 0)

10+ Year Member



this is currently my .htacess file. The real i.p. has been replaced with fake numbers:
--------------------------------
order allow,deny
deny from 12.51.60.161
deny from 12.51.60.161
deny from 12.51.30.166
deny from 12.51.12.233
deny from 12.51.31.36
deny from 12.51.13.120
deny from 12.51.14.65
deny from 12.51.14.65
deny from 12.51.14.44
deny from 12.50.0.0/15
deny from 12.51.255.255
deny from 12.50.0.0
allow from all
---------------------------

Will this keep the person I want out?

kryptonsite

5:43 am on Apr 9, 2005 (gmt 0)

10+ Year Member



Anyone? :-()

lammert

6:12 pm on Apr 9, 2005 (gmt 0)

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



Are you sure it is a human and not a search engine bot? Search engine spiders like Googlebot are also visiting from many different IPs. It could also be AOL or another large ISP where many surfers are tunneled through a small set of IP addresses.

I only ban IPs if I am pretty sure that it is a returning visitor who wants to harm my site.