For Mandriva Linux 2009.0
My son discovered torrents... Nuf sed. This guide briefly shows how to rate limit an internet connection using QOS and 'tc' filters.
Exhaustive details are at http://lartc.org.
The firewall is a NAT system running on a Linux server where eth0 connects to the DSL modem and eth1 connects to the LAN. Using only four rules, one can limit the LAN traffic over DSL, leaving the server itself with the rest of the bandwidth. The first rule marks all LAN packets travelling over eth1 and the other three rules rate limit them on the DSL eth0:
# Rate limit everything on eth0 that moves over eth1 iptables -A PREROUTING -t mangle -i eth1 -j MARK --set-mark 6 tc qdisc add dev eth0 root handle 1: cbq avpkt 1000 bandwidth 100mbit tc class add dev eth0 parent 1: classid 1:1 cbq rate 256kbit \ allot 1500 prio 5 bounded isolated tc filter add dev eth0 protocol ip parent 1:0 prio 1 handle 6 fw flowid 1:1
That is all there is to it.
If you need to, then you can limit only the IP or MAC address of a single host machine by modifying the iptables rule.
La voila!