IPTables哈希限制 – 以上不正确的计数

我目前在尝试设置IPTables的规则来限制某些数据包时遇到了麻烦。 我不能在iptables上使用正常的限制模式,因为这必须按照dstip和dstport。

规则如下所示:

iptables -A PREROUTING -t raw -p udp -m hashlimit -m u32 --u32 "0x0>>0x16&0x3c@0x9&0xff=0x55" --dport 27015:27105 --hashlimit-mode dstip,dstport --hashlimit-above 500/sec --hashlimit-name PLAYERQUERY -j DROP 

这似乎工作正常,并会有显着的数额进来时,速度限制,但我可以看到即使在500 /秒的限制下,随机数据包被丢弃。 我正在使用我们的节点上的wiresharkvalidation这一点,我只能看到20秒一秒。

有些数据包的另外两个示例过早丢失:与另一个规则相同的随机丢失:

 iptables -A INPUT -m hashlimit -m tcp -p tcp --dport 80 -i eth0 --hashlimit-above 256/sec --hashlimit-burst 512 --hashlimit-mode srcip --hashlimit-name reg_html1 -m state --state NEW -j DROP 

而在lo(vs eth0)上,匹配的第一个数据包全部被丢弃了!