问题描述
我需要一些帮助将 netem 延迟定向到特定 IP.我已经正确输入了所有命令,没有错误,如所附图片所示.我的速度测试没有延迟.有关更多信息,当我使用命令:tc qdisc add dev eth0 root netem delay 100ms"时,延迟被完美添加.我究竟做错了什么 ?
I need some help directing netem delays to a specific IP. I have inputted all the commands correctly with no errors and as shown in the pictures attached. I have no latency being added to my speed tests. For further information when I used the command: "tc qdisc add dev eth0 root netem delay 100ms" the delays are added flawlessly. What am I doing wrong ?
附言我是使用TC和NETEM的初学者,所以如果有任何解决方案,请在解释时彻底.
P.S. I am a beginner at using TC and NETEM, so please if any solutions are given please be thorough when explaining.
以下是一些屏幕截图,以便更好地理解我的问题:
Here are some screenshots for a better understanding towards my problem:
http://postimg.org/image/k9pu6uhxv/http://postimg.org/image/tis0gyqtv/
推荐答案
tc qdisc del dev eth0 root
tc qdisc add dev eth0 root handle 1: htb
tc class add dev eth0 parent 1: classid 1:1 htb rate 100mbit
tc filter add dev eth0 parent 1: protocol ip prio 1 u32 flowid 1:1 match ip dst 192.168.2.219
tc qdisc add dev eth0 parent 1:1 handle 10: netem delay 25ms 5ms
- PS:通过添加 5ms 抖动延迟,您还可以创建数据包重新排序在网络中.假设这就是您想要的.
- PPS:我不确定添加抖动是否会导致重新排序在 OpenWRT 中.但它在 Linux 内核中确实如此.自 2010 年以来,Netem 经历了无数变化.
PPPS:为了引入无数据包重新排序的抖动,设置一个非常高的速率限制.
- PS: by adding 5ms jitter to delay, you also create packet reorderingin the network. Assuming that this is what you want.
- PPS: I am not sure whether adding jitter creates reordering or notin OpenWRT. But it surely does in the Linux kernel. Netem has undergone umpteen number of changes since 2010.
PPPS: To introduce jitter w/o packet reordering, set a very highrate limit.
tc qdisc add dev eth0 parent 1:1 handle 10: rate 1000 mbit netem delay 25ms 5ms
这篇关于如何用NETEM进行tc过滤?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!