iptables / nat / prerouting忽略UDP数据包?

在具有不同内核版本的许多服务器上效果相同。

有多个Iptables DNAT规则:

iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 12345 -j DNAT --to-destination 10.20.30.40:5678 iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 23456 -j DNAT --to-destination 10.11.12.13:5789 .... iptables -t nat -A PREROUTING -i eth0 -p udp --dport 34567 -j LOG --log-prefix 'natudp: ' iptables -t nat -A PREROUTING -i eth0 -p udp --dport 34567 -j DNAT --to-destination 10.55.66.77:34567 

问题:UDP规则不适用于来自eth0的传入请求。
数据包和字节计数器为零值。
简化(移除dport)不起作用。
结果,请求被传递给filter / INPUT链而不是FORWARD。

没有来自虚拟接口(tap,veth)的数据包的这种问题 – 它们被预先规则所困住。
TCP没有这样的问题。
没有这样的UDP 问题的答案
但是,来自eth0的UDP请求根据预先路由规则被忽略:

 # iptables -t nat -nvL PREROUTING Chain PREROUTING (policy ACCEPT 3 packets, 174 bytes) pkts bytes target prot opt in out source destination (testing rules) 2 126 LOG udp -- * * 0.0.0.0/0 0.0.0.0/0 LOG flags 0 level 4 prefix "prerouting-udp: " 0 0 udp -- * * 1.2.3.4 0.0.0.0/0 0 0 udp -- * * 1.2.3.4 0.0.0.0/0 udp dpt:25826 0 0 udp -- eth0 * 0.0.0.0/0 0.0.0.0/0 udp dpt:25826 0 0 udp -- eth0 * 1.2.3.4 0.0.0.0/0 0 0 udp -- eth0 * 1.2.3.4 0.0.0.0/0 udp dpt:25826 (production rules) 7 412 DNAT tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:12345 to:10.20.30.40:8080 63 3804 DNAT tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:56789 to:10.30.40.50:8000 0 0 DNAT udp -- eth0 * 1.2.3.4 0.0.0.0/0 udp dpt:25826 to:10.40.50.60:25826 

有任何想法吗?