How to create a Download Quota on a Server/Gateway to the Intenrnet?

How to create a Download Quota on a Server/Gateway to the Intenrnet?

Post by Osgaldo Suanze » Sat, 28 Jun 2003 00:24:09



Hi.
Im currently running a Debian Woody as an Internet Gateway for 9 Lan Users.
I would Like to assign to each user a Download Quota on a weekly basis.
So that if User1 on the Lan gets 20MB/week , if he download 20MB on the
first day
he would be blocked on the Gateway and could not get out to the Internet,
until
the next week, or when the administrator allows him so (resetting the
counters..?)
Has someone allready done this? Is there something available I can use?.
I have seen a few packet counters for billing purposes, but nothing I could
adapt
for my needs. Im sure that someone knows what Im looking for,.

        I really need some advice.

                                    Osgaldo.

 
 
 

How to create a Download Quota on a Server/Gateway to the Intenrnet?

Post by Peteris Krumin » Sat, 28 Jun 2003 03:46:29




Quote:> Hi.
> Im currently running a Debian Woody as an Internet Gateway for 9 Lan
> Users. I would Like to assign to each user a Download Quota on a
> weekly basis. So that if User1 on the Lan gets 20MB/week , if he
> download 20MB on the first day
> he would be blocked on the Gateway and could not get out to the
> Internet, until
> the next week, or when the administrator allows him so (resetting the
> counters..?)
> Has someone allready done this? Is there something available I can
> use?. I have seen a few packet counters for billing purposes, but
> nothing I could adapt
> for my needs. Im sure that someone knows what Im looking for,.

>         I really need some advice.

>                                     Osgaldo.

There is an iptables match exactly for that, called quota.
http://netfilter.org

simple example (silly) -
allow only 200 bytes of icmp traffic outgoing of box:
 iptables -A OUTPUT -m quota --quota 200 -p icmp -o eth0 -j ACCEPT
 iptables -A OUTPUT -p icmp -o eth0 -j DROP

queue match is very buggy (at least in iptables 1.2.7a), so cant simply
zero counters after a week. you have to remove the rules and then add
them again.
Put this method (a script) in crontab and you'll have exactly what you
needed.

P.Krumins

 
 
 

1. Quotas : Format of quota.users & quota.groups ?

Hi,

I am running Linux-FT with kernel 1.2.13 and quota patches. I would like
to enable quotas in order to control memory usage by apps (I'm trying to
debug an app that keeps grabbing all system memory, preventing me from
typing kill).

In order to enable quotas, files called quota.users and quota.groups
need to be present in the root directory. The 'edquota'
program is supposed to be used to set these up, but it simply invokes vi,
expecting the user to know the file format. The man pages say that
the file format is 'inscrutable', but don't actually describe it anywhere!

Anyone know the correct format ?

Thanks in advance,

Steve

-----------------------------------------------------------------------------
| Steve Mottram                                                             |
|                                                                           |
| University Department of Anaesthesia  |    Internal Phone : LRI 5694      |
| Leicester Royal Infirmary             |    Phone  :  +44 (0)116 258 5291  |
| Leicester LE1 5WW                     |    Fax    :  +44 (0)116 285 4487  |

|---------------------------------------------------------------------------|
| Witty bit deleted due to budget cuts.                                     |
|---------------------------------------------------------------------------|

2. C-Kermit 7.0 Beta.11 ready for testing

3. Gateway - Setting up Linux as a gateway server

4. SCSI tape setup: unit -1 missing?

5. Bandwith Limiting / Download Quota's - How?

6. Suexec question

7. Bandwidth Limiting / Download Quota's with Linux

8. Blender users? Help appreciated!!

9. quotas on downloads ?

10. Download Quota with Squid?

11. The Great gateway Train or how to gateway behind the gateway

12. how to create quota for each user?

13. Quota and root created user owned files