# Shaping based on monthly bandwidth limit (comcrap's 250GB quota)?

• Is there a way to setup a monthly bandwidth quota? For example, comcrap's 250GB limit. Is there a way to limit the wan to 250GB aka auto disabling it when that limit is hit? Even better, would there be a way to set a limit to 250GB and auto limit the WAN less and less as it approches the 250GB limit? Like, at 245GB 90% of the upload traffic is limited in speed? This way incoming traffic still works without being cut off. Such a formula could be expressed in available GB for the rest of the month to how many days are remaining in the month. Something like:

quota=monthly quota in kB
x=total amount of bandwidth consumed so far for this month in kB
86400 seconds in a day
y=days remaining in the month

z=(quota-x)/86400/y

250GB = 262,144,000kB
quota=262,144,000

z=(262,144,000-x) / 86400/y

So lets say it is a new month so you've downloaded+uploaded 0kB. Also, there is 30 days remaining. The formula would then be: z=(262,144,000-0) / 86400/30