Re: [squid-users] Http access control

From: Colin Campbell <sgcccdc@dont-contact.us>
Date: Mon, 11 Mar 2002 14:58:54 +1000 (EST)

Hi,

On Sun, 10 Mar 2002, Su - wrote:

> Hi
> I using Squid v2.3. Now i like to control only certain
> PCs, eg. PC with Ip Address of 192.168.0.4 ,
> 192.168.0.20 are allowed to access Internet. My
> network IP address is from 192.168.0.1 -> 192.168.0.50
> , Subnet 255.255.255.0
>
> How can i do so ?
>
> I tried this way :
>
> #acl allowed_hosts src 192.168.0.0/255.255.255.0
> acl allowed_hosts src 192.168.0.4/255.255.255.0
> acl allowed_hosts src 192.168.0.20/255.255.255.0

You have

a) redefined allowed_hosts. The second one overrides the first.

b) masked off the host address with the netmask.
   (192.168.0.4/255.255.255.0 becomes 192.168.0.0, ie everything). If you
   look at your logs you'll probably see a message asying that's what
   you've done.

> But when i test , still all PCs able to do so. The
> result i got, is either deny all PCs, or allow all
> pCs.

What you want is something like:

acl myfriend1 src 192.168.0.4
acl myfriend2 src 192.168.0.20
acl all src 0.0.0.0/0.0.0.0

http_access allow myfriend1
http_access allwo myfriend2
http_access deny all

Colin
Received on Sun Mar 10 2002 - 21:59:08 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 17:06:48 MST