TC警方通过iptables处理数据包?

我想限制下载速度从任何IP到800kbit,(这个工程)我想限制标记数据包的下载速度为400kbit。

我没有得到任何错误,但它不限制标记为30的数据包的下载速度。我已经用iptables-save -c确认数据包被正确标记。 所以我认为我的过滤语法拾取句柄30是错误的,即使没有错误。

/sbin/tc qdisc add dev $DEV handle ffff: ingress /sbin/tc filter add dev $DEV parent ffff: prio 40 protocol ip handle 30 fw police rate 400kbit burst 10k drop flowid :1 #slightly different order of parameters, also doesn't work /sbin/tc filter add dev $DEV parent ffff: protocol ip prio 40 handle 30 fw police rate 400kbit burst 10k drop flowid :1 #if I set the priority to 50 then I get an error saying "We have an error talking to the kernel" #kernel is 4.4.50 /sbin/tc filter add dev $DEV parent ffff: protocol ip prio 50 u32 match ip src 0.0.0.0/0 police rate 800kbit burst 10k drop flowid :1 

类似的tc命令(标记数据包的监pipe率)如下例所示: $TC filter add dev $INDEV parent ffff: protocol ip prio 50 handle 1 fw police rate 1kbit burst 40 mtu 9k drop flowid :1 http:// linuxdocs .org / HOWTOs / Adv-Routing-HOWTO-14.html同样的例子也出现在这里https://www.iplocation.net/lartc-ddos

如果我手动添加一个特定的IP的另一个规则高于catchall或优先级较低的同等优先级,那么我可以限制速度为400kbit / s。 但是我想限制iptables标记/修改的数据包的速度。

这是一组有效的命令,但问题是标记是在处理入口qdisc之后发生的。