How do I limit the number of simultaneous web connections from a client system via the Squid proxy server?

Posted: August 15, 2007 in LINUX
Tags:

How do I limit the number of simultaneous web connections from a client system via the Squid proxy server?

 

Using Squid’s maxconn Access Control List (acl) element it is possible to limit simultaneous web connections coming from client systems that use a Squid proxy server. To use the maxconn element, the “client_db on” directive should be set. By default this is activated in the /etc/squid/squid.conf configuration file.

Edit the /etc/squid/squid.conf file and look for the fields listed below to be able put the maxconn parameters afterwards:

# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS

# Example rule allowing access from your local networks. Adapt
# to list your (internal) IP networks from where browsing should
# be allowed
#acl our_networks src 192.168.1.0/24 192.168.2.0/24
#http_access allow our_networks

Here is an example of limiting 5 simultaneous web access from the same client system:

acl STUDENTS 192.168.3.0/24
acl numbercon maxconn 5
http_access deny STUDENTS numbercon

Restart the Squid service for the changes to take effect:

service squid restart

http://www.redhat.com/magazine/011sep05/departments/tips_tricks/
    Advertisements

    Leave a Reply

    Please log in using one of these methods to post your comment:

    WordPress.com Logo

    You are commenting using your WordPress.com account. Log Out / Change )

    Twitter picture

    You are commenting using your Twitter account. Log Out / Change )

    Facebook photo

    You are commenting using your Facebook account. Log Out / Change )

    Google+ photo

    You are commenting using your Google+ account. Log Out / Change )

    Connecting to %s