Banning block of IP addresses in .htaccess

This is a discussion on Banning block of IP addresses in .htaccess within the Apache Web Server forums, part of the Web Server and Related Forums category; Alfred Molon wrote: > I'm familiar with the 'deny from' Apache directive: > > <Files .htaccess> > ...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-01-2007
Jim Hayter
 
Posts: n/a
Default Re: Banning block of IP addresses in .htaccess

Alfred Molon wrote:
> I'm familiar with the 'deny from' Apache directive:
>
> <Files .htaccess>
> order allow,deny
> deny from all
> </Files>
>
> order allow,deny
> deny from a.b.c.d
>
> Now, how does the directive looks like if you want to ban the following
> range of addresses:
>
> a.b.c.0 - a.b.c.127 ?


deny from a.b.c.0/24

Above based on the fact that I use "allow from a.b.c.192/28" to allow
access from our office.

Jim
  #2 (permalink)  
Old 11-01-2007
HansH
 
Posts: n/a
Default Re: Banning block of IP addresses in .htaccess

"Jim Hayter" <see.reply.to@nowhere.invalid> schreef in bericht
news:13ik3kusqjef58@news.supernews.com...
>> Now, how does the directive looks like if you want to ban the following
>> range of addresses:
>>
>> a.b.c.0 - a.b.c.127 ?

>
> deny from a.b.c.0/24
>

I'ld rather say 'deny from a.b.c.0/25'
-or 'deny from a.b.c.0/255.255.255.128' -
http://httpd.apache.org/docs/2.2/mod...ost.html#allow

HansH


  #3 (permalink)  
Old 11-01-2007
Jim Hayter
 
Posts: n/a
Default Re: Banning block of IP addresses in .htaccess

HansH wrote:
> "Jim Hayter" <see.reply.to@nowhere.invalid> schreef in bericht
> news:13ik3kusqjef58@news.supernews.com...
>>> Now, how does the directive looks like if you want to ban the following
>>> range of addresses:
>>>
>>> a.b.c.0 - a.b.c.127 ?

>> deny from a.b.c.0/24
>>

> I'ld rather say 'deny from a.b.c.0/25'
> -or 'deny from a.b.c.0/255.255.255.128' -
> http://httpd.apache.org/docs/2.2/mod...ost.html#allow
>
> HansH


Good point (/25, not /24). I didn't read closely enough.

Jim
  #4 (permalink)  
Old 11-02-2007
Alfred Molon
 
Posts: n/a
Default Banning block of IP addresses in .htaccess

I'm familiar with the 'deny from' Apache directive:

<Files .htaccess>
order allow,deny
deny from all
</Files>

order allow,deny
deny from a.b.c.d

Now, how does the directive looks like if you want to ban the following
range of addresses:

a.b.c.0 - a.b.c.127 ?
--

Alfred Molon
http://www.molon.de - Photos of Asia, Africa and Europe
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:11 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0