LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 06-25-2003, 02:20 PM   #1
osgaldo
LQ Newbie
 
Registered: Jun 2003
Posts: 3

Rep: Reputation: 0
How to create Download Quota on a Server/Gateway?


Hi.
I have a Debian Woody server which I use as an Internet-Gateway
for 9 Lan Users. Is there a way to assign each user some MB/per day/or week?
I would like for example assign 20MB Download Quota to user 1 on the Lan, and after he downloaded 20 MB (using www,mail,mp3...) he is Blocked from using the Internet on the gateway until the next day/week reaches and start again from 0MB.
Has anyone done this before? Is there something out there I can use, maybe based on Iptables, some packet counting script on each IP.....


Any Idea? I really need some help, please.
 
Old 06-27-2003, 12:44 AM   #2
jayakrishnan
Member
 
Registered: Feb 2002
Location: India
Distribution: Slacky 12.1, XP
Posts: 991

Rep: Reputation: 30
Try iptables
 
Old 06-27-2003, 03:39 AM   #3
soob
Member
 
Registered: May 2003
Location: A country town, Australia
Distribution: Debian
Posts: 72

Rep: Reputation: 15
I just read a bandwidth limiting HOWTO on tldp.org - it talked about limiting traffic rates, but not total megabytes, but may be helpful.

http://www.tldp.org/HOWTO/Bandwidth-...WTO/index.html

Here's an approach with scripts and iptables: set up an iptables rule to forward traffic for each user's IP address, so you get byte counts for each one. Then you can read them with "iptables -L -nxv" and zero them all at midnight with "iptables -Z"

Then you'll have to run a script every (say) 5 minutes to see if anyone had passed their quota, and block them (by adding another iptables rule) if they had. I guess this ought to be possible as a shell script, but I haven't seen one.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I want to download quota package....??? Khmer Linux - Enterprise 2 12-01-2005 07:08 PM
I want to download quota package Khmer Linux - Software 1 12-01-2005 04:08 PM
How to create quota for a user. gian2oo1 Slackware 1 03-13-2005 07:20 PM
Download Quota fritz001 Slackware 0 01-01-2005 01:48 PM
Where can I download the quota? minor General 2 06-05-2001 04:51 AM


All times are GMT -5. The time now is 08:50 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration