Traffic Throttling on Linux

I guess I should document this since I spent some time to get this to work.

In short, to rate limit a box to 30MB/s
tc qdisc add dev eth1 root tbf rate 30mbps burst 10kb latency 70ms mtu 100000

The reason why we set mtu to 10000 is because of this.

To delete this rule:
tc qdisc del dev eth1 root

And to view current setting:
tc -s qdisc ls dev eth1

紫荆的端口认证………

昨晚心血来潮想试一下vBox的网络桥接,结果晚上没整好就困了,今早起床发现tunet都连不上了。于是开始检查,发现连路由都ping不通。把昨晚做的事情还原,再ping,还是不通。检查路由表,对的啊,删掉重建,还是不通。怀疑arp表错了,把原先设定的静态ARP删了,还是不行。开ethereal,抓不到任何回来的包。ping的结果始终是unreachable error。折腾了一个早上加上一个午饭时间,都快抓狂了。求助于Terrence同学,“这个不是本来就ping不通的么”,一语惊醒,想起前两天我好像也和别人也说过这个的。直接连tunet,绿花闪,我在哭…..

可恶的端口认证。