Friday, September 17, 2010

Using tc to regulate downlink speed

tc qdisc add dev eth0 handle ffff: ingress
tc filter add dev eth0 parent ffff: protocol ip prio 50 u32 match ip src 0.0.0.0/0 police rate
100kbit burst 10k drop flowid :1

The second command limits the download rate to 100kbit by dropping packets. Since we do not want to drop too many packets, we setup a burst size size of 10k.

See this link for more details.
http://lartc.org/howto/lartc.cookbook.ultimate-tc.html

No comments: