Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there a way to limit lets say in iptables or any proxy solution/software if a user is downloading a filesize that is greater than lets say 20MB it will limit his entire download at 2KB/s?

Basically i want to put a server between me and my modem and if the user is downloading a file based on extensions or http download it will limit him to 2KB the entire download.

Is this possible? I know that somehow the packets need to be read but im lost at how to implement this.

Basically if a user downloads a file via http thats over 20MB it will limit his speed to 2KB is all im trying to implement.

share|improve this question
    
Regardless of how you do it this won't be fool proof, as HTTP downloads require the site to provide a Content-Length for the browser to know the expected size. If they didn't, then the browser will just download it until it's done, without knowing the length/size in advance. –  Ƭᴇcʜιᴇ007 Sep 12 '13 at 16:38
    
I see, is there any solution or package available to do something like this? Or achieve something close? –  sonicboom Sep 12 '13 at 16:41
    
There's lots of options/solutions for Quality of Service (QoS - check your router for instance) for controlling bandwidth for certain services/protocols and even users in some cases. But doing it be file size isn't usual at all - partially because of what I mentioned I'm sure. Having said that, while I don't know of anything that will do it, someone else might. :) –  Ƭᴇcʜιᴇ007 Sep 12 '13 at 16:45
    
So it is probably a custom solution i would be needing then? Yeah i see what you mean –  sonicboom Sep 12 '13 at 16:45
    
I think the Tomato router firmware's QoS has an option to classify a connection under bulk priority after a certain amount of data is transmitted, but I'm not sure how common such a feature is in general. –  jjlin Sep 12 '13 at 22:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.