delay延迟 tc qdisc add dev enp0s3 root netem delay 1000ms
命令详解 qdisc: 类型为 queuing discipline,不懂的请先查询一下基本概念 add: add a new rule dev eth0: rules will be applied on device eth0 root: modify the outbound traffic scheduler (aka known as the egress qdisc) netem: use the network emulator to emulate a WAN property delay: the network property that is modified 1000ms: introduce delay of 1000 ms
执行前
执行后
delay最后还是有两个参数
命令1.增加振幅
delay不是一个固定的值,而是在后面这个参数的增加减少幅度内变动
tc qdisc add dev enp0s3 root netem delay 1000ms 500ms
参数说明: tbf: use the token buffer filter to manipulate traffic rates rate: sustained maximum rate burst: maximum allowed burst latency: packets with higher latency get dropped
其他操作
删除 tc qdisc del dev enp0s3 root
修改 tc qdisc change dev enp0s3 root netem delay 1000ms
# tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dport 80 0xffff flowid 1:11 # tc filter add dev eth0 prtocol ip parent 1:0 prio 1 u32 match ip dport 25 0xffff flowid 1:12 # tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dport 23 oxffff flowid 1:13