how to configure squid

Hakan Koseoglu hakan at koseoglu.org
Tue Jun 15 17:12:48 UTC 2010


Ning,

On 15 June 2010 16:29, ning luwen <ningluwen at gmail.com> wrote:
> Hi,
> I have a problem set up squid. described as follow:
>
> the squid server ip for example ,a.b.c.d,
> after setup , the ips like a.b.c.e can use the http proxy normally,
> but ips like f.g.h.i just can not use the proxy.

If you gave your IP addresses it would be easier to help you.
Most likely you are having problems with your ACL setup.
The Squid config file in /etc/squid$version has the following bits as
an example:

# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
acl localnet src 10.0.0.0/8     # RFC1918 possible internal network
acl localnet src 172.16.0.0/12  # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network

This means that the subnets above are accepted as local networks.

Later down the config file, commands like these appear:

http_access allow localnet

This lets the localnet network use the http.

If you want to let some random network which is not local, define it
similar to localnet and configure the http_access to allow for
connections, for example

acl someremotenet src f.g.h.0/8
http_access allow localnet someremotenet

Then  restart squid with /etc/init.d/squid$version restart command (or
whatever service method you'd care to use).

squid$version might be squid or squid3 (on my 8.04.4LTS server) or
just squid3 on 10.04 LTS.

Reading through the excellently documented squid.conf actually will
make things a lot clearer.
-- 
Hakan (m1fcj) - http://www.hititgunesi.org




More information about the ubuntu-users mailing list