|
/Admin/LAN:
(Not Working) Use CBQ.init to Control / Limit Bandwidth Useage by IP
Otherwise known as "bandwidth shaping".
Next (in Debian) install the "shaper" package, which contains the CBQ.init[1] init script. Its not very well documented, but there is a little bit[2]. The best source for information in the installed package is the comments of the script itself: /etc/init.d/shaper.
I dropped the hammer on my bandwidth abuser by creating two files: /etc/shaper/cbq-20.101-internet:
DEVICE=eth0,2Mbit,200Kbitand /etc/shaper/cbq-20.internet-101:
RATE=30Kbit
WEIGHT=3Kbit
PRIO=5
RULE=192.168.8.101,
DEVICE=wlan0,2Mbit,200Kbit
RATE=30Kbit
WEIGHT=3Kbit
PRIO=5
RULE=192.168.8.101
Note that this configuration has 192.168.8.101 on the wlan0 wireless network, and eth0 is the internet-facing interface.
If you wish to watch the bandwidth in real-time, install the "nload" terminal utility. And of course, do not forget to restart shaper:
/etc/init.d/shaper restart
According to the docs, shaper can do a lot more complicated things, like limiting aggregrate traffic to a block of IPs, or limiting traffic to a specified port. It also would appear to be able to use priorities and the concept of aggregation to allow a lower priority user to borrow unused bandwidth from a higher priority user.
Unfortunately, as of this writing, shaper / CBQ.init seems to be not working. It seems to make the network almost unusable for the user being capped, no matter how big the RATE setting. I have issued a bug report and will continue investigating.
[1] http://sourceforge.net/projects/cbqinit/
[2] http://www.faqs.org/docs/Linux-HOWTO/Bandwidth-Limiting-HOWTO.html#CBQ
posted at: 07:23 | path: /Admin/LAN | permanent link to this entry