IPtables to stop Bandwidth completely
Goodday
Throttling is not what Im after. Let me explain this very simply. Set an iptable rule to totally block all bandwidth from a client when they reach a certain value. Doesnt even matter if the client is trying to upload a 5k document. Any and all communication must be stopped after a value. Is iptables the right system? Thinking along the line to apply a rule to an IP. Peon South Africa |
Quote:
|
HI OSOR
Please could you eloborate a bit further regards, Peon |
Quote:
For example, let’s say I route traffic to three clients: A, B, and C (whose IP addresses are 10.0.0.10, 10.0.0.11, and 10.0.0.12 respectively). My policy is that client A will be capped at a limit of 1GB (1073741824 bytes), and clients B and C share a quota of 2GB (2147483648 bytes). This means that once the combined traffic of B and C reaches 2GB, neither of them will have access to my packet forwarding. So in the filter table, I might have these rules (implementing two separate quotas): Code:
iptables -N A |
iptables -P A DROP (bad built-in chain name)
|
Quote:
If I were to give a disclaimer about my imperfect advice, it would go here… ;) |
Works like a charm!! Insert MASSIVE smiley face of happy and thanks...
:D:D:D:D:D:D:D:D:D Say now I would like to reset A's stats ? regards, Peon |
Quote:
So the only way to “reset” a quota is to delete and re-add the rule. E.g., if you are reseting client A’s quota in the example from post four, try this: Code:
iptables -D A 1 An additional caveat (caused by the lack of /proc interface) is the inability to save the state and reload it. So once the router is powercycled, even if you use iptables-save and iptables-restore, you will inadvertently reset the quota (i.e., there is as of yet no way to remember how much of the quota your client has used when you restart the computer). The only way to prevent this is to keep your computer running all the time (which is not so unusual for a router). |
True what saying, simply create scripts for IP and run them when they full. Also the uptime and saving of data is not so important.
This is used a added service at folks guest house. People only need about 10mb to do their business. I dont plan on starting an ISP or such. Osor, have you seen the bandwidth throttling on a ClarkeConnect distro? If so, in what direction could you point me to learn the best way to throttle bandwidth. Such as in ClarkeConnect 4. Thanks for the help. regards, |
All times are GMT -5. The time now is 10:54 PM. |