什么是Iptables中的匹配标记字段

在下面的例子中

iptables -A FORWARD -i eth0 -p tcp --syn -m mark --mark 0x3 -j REJECT --reject-with tcp-reset 

-m mark --mark字段的意义是什么?

当我试图添加此规则时,我收到以下错误。

 iptables: Protocol wrong type for socket ? 

谢谢。

我已经将我的内核从版本2.6.24升级到版本2.6.32,但是我的iptables没有升级,他们停留在1.3.6。 如果我想使用MARK,出现错误消息“iptables:协议错误types的套接字”。 将iptables升级到版本1.4.8后,一切正常。

标记匹配被netfilter用来匹配在mangle表中标记的数据包。不知道具体情况我猜你的内核是非常过时的/你的内核编译错误或者你的netfilter包可能需要看看。

-iptables手册页 –

标记此模块匹配与数据包关联的netfilter标记字段(可以使用下面的MARK目标进行设置)。

  [!] --mark value[/mask] Matches packets with the given unsigned mark value (if a mask is specified, this is logically ANDed with the mask before the comparison).