PDA

View Full Version : Apache Server .htaccess IP filtering



justinsg
17-01-2010, 06:17 PM
Hi,

How do I tell apache to "Allow from 192.168.1.1 thru 192.168.99" i.e. all of 192.168.1.1, .2, .3, .4, .5 etc.

Sorry - its not really a pc question...
Justinsg

justinsg
17-01-2010, 06:24 PM
I've kinda fixed it... tell me if this is correct:

Allow from 192.168.1.100/255.255.255.100

MushHead
17-01-2010, 09:47 PM
It seems to be just:

Allow from 192.168.1.

Erayd
18-01-2010, 06:29 AM
I've kinda fixed it... tell me if this is correct:

Allow from 192.168.1.100/255.255.255.100
That most definitely is not correct - 255.255.255.100 is not a valid subnet mask, for any network.

'Allow from 192.168.1.0/25' or 'Allow from 192.168.1.0/255.255.255.128' is probably the closest to what you want - it will grant 192.168.1.0 - 192.168.1.127 access to whatever resource this is you're trying to protect. Both examples are just different ways of writing the same thing.


It seems to be just:

Allow from 192.168.1.Nope - that will allow 192.168.1.anything to access the resource, which isn't what the OP wants.

justinsg
18-01-2010, 07:52 AM
Yes but no...
I want to grant access to all of 192.168.1.* but deny access to 192.168.1.1 and simply putting a "deny from ..." line doesn't work because the order is deny allow so the "allow from 192.168.1." statement below it simply allows 192.168.1.1 again.