[yz@bogon yz]$ sudo tc qdisc add dev enp0s8 root handle 10: htb # 需要root权限 [yz@bogon yz]$ tc -s qdisc show dev enp0s8 # 显示 qdisc htb 10: root refcnt 2 r2q 10 default 0 direct_packets_stat 55 direct_qlen 1000 Sent 6350 bytes 55 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 [yz@bogon yz]$ sudo tc class add dev enp0s8 parent 10: classid 10:1 htb rate 10mbit # 需要root权限 [yz@bogon yz]$ tc -s class show dev enp0s8 # 显示 class htb 10:1 root prio 0 rate 10Mbit ceil 10Mbit burst 1600b cburst 1600b Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 lended: 0 borrowed: 0 giants: 0 tokens: 20000 ctokens: 20000 [yz@bogon yz]$ sudo tc filter add dev enp0s8 parent 10: protocol ip prio 10 handle 1: cgroup # 需要root权限 [yz@bogon yz]$ tc -s filter show dev enp0s8 # 显示 filter parent 10: protocol ip pref 10 cgroup filter parent 10: protocol ip pref 10 cgroup handle 0x1