参考于https://blog.csdn.net/scdxmoe/article/details/78532425?utm_source=blogxgwz8
例如:对本地网卡上30001 端口延迟5秒
tc qdisc add dev lo root handle 1: prio bands 4
tc qdisc add dev lo parent 1:4 handle 40: netem delay 5s
tc filter add dev lo protocol ip parent 1:0 prio 4 u32 match ip dport 30001 0xffff flowid 1:4
列出filter的信息
tc -s filter show dev lo
filter parent 1: protocol ip pref 4 u32 filter parent 1: protocol ip pref 4 u32 fh 800: ht divisor 1 filter parent 1: protocol ip pref 4 u32 fh 800::800 order 2048 key ht 800bkt 0 flowid 1:4 (rule hit 672 success 76) match 00003714/0000ffff at 20 (success 76 )
删除filter
tc filter del dev lo pref 4