设置带宽的命令
tc qdisc del dev eth1 root
tc qdisc add dev eth1 root handle 1: htb r2q 1
tc class add dev eth1 parent 1: classid 1:1 htb rate 3000kbit burst 10k
[root@chdvm ~]# tc class ls dev eth1
class htb 1:1 root prio 0 rate 3000Kbit ceil 3000Kbit burst 10Kb cburst 1599b
同时设置丢包和带宽。
[root@chdvm ~]# tc qdisc del dev eth1 root
[root@chdvm ~]# tc qdisc add dev eth1 root handle 1: htb
[root@chdvm ~]# tc class add dev eth1 parent 1: classid 1:1 htb rate 3000kbit burst 10k
[root@chdvm ~]# tc qdisc add dev eth1 parent 1:1 handle 10: netem delay 100ms
[root@chdvm ~]# tc qdisc ls dev eth1
qdisc htb 1: root r2q 10 default 0 direct_packets_stat 0
qdisc netem 10: parent 1:1 limit 1000 delay 100.0ms
[root@chdvm ~]# tc class ls dev eth1
class htb 1:1 root leaf 10: prio 0 rate 3000Kbit ceil 3000Kbit burst 10Kb cburst 1599b
class netem 10:1 parent 10: