From: Ozan UÇAR <mail@xxxxxxxxxxxx> > John Doe yazmış: > > From: Ozan UÇAR <mail@xxxxxxxxxxxx> > >> I have been on the lookout for a solution to limit the number of users >allowed to connect to the Internet. What I am looking for is not maxconn. I do >not wish to limit the number of total connections per client. A client can >have as many connections as s/he wishes. Say, I want to limit Internet access >to 20 users. I have been reading the manuals and googling for awhile now, with >no luck. Anyone know of a way to achieve this? > > Don't you think limiting the bandwidth per user with delay pools would be >better (more fair)...? > > But if you really want to limit the number of users, maybe you could use an >external acl that will take note of the src IPs (with a given ttl, so no ttl on >the squid side). > > If at a given time your list of IPs includes more than 20 IPs (different >than the current one), deny... > > Those IPs will be taken off the list when they reach their ttl. > > You could implement a fifo stream so that when the first IP is taken out, >the 21th becomes the 20th and is accepted... > > But that means they might receive only half of their webpage if the ttl >expire in the middle... > > So you could reset the ttl of an IP at each connection... > > But, with this setup, these 20 users could block others access forever if >they are really active... > > Anyway, I do not think it is a good idea... > 1. How do I reset the TTL of an IP? You have to handle it in your external helper program (so it depends how you implement it, memcache, home made fifo list, etc)... You have to develop this program in whatever language you know (C, perl, python...). > 2. Do you know of any example external ACLs that can be used to limit number >of users? After all, if there is a way to limit number of users, that is what >I'm looking for.. If there was such an helper, I would have just pointed to it. ^_^ Maybe others will point to one... http://www.squid-cache.org/Doc/config/external_acl_type/ By curiousity, why do you seek such limit...? JD