在Enterprise Linux 6上使用iptables NAT来破坏端口

我正尝试使用以下configuration在CentOS上设置强制网页门户redirect:

此configuration适用于前几个数据包,但突然间,目标端口在来自服务器的响应中损坏。 数据包跟踪如下所示:

客户端:制作原始networking请求的主机。 服务器:请求门户的原始目标:强制门户服务器

此数据包跟踪是从可以看到客户端和门户网站stream量的位置获取的。 以c:开头的行来自客户端,而p:来自门户端。

c: client:57877 -> server:80 [SYN] p: client:1092 -> portal:80 [SYN] NAT adjusted SYN p: portal:80 -> client:1092 [SYN, ACK] c: server:80 -> client:57877 [SYN, ACL] NAT reversed on the SYN/ACK c: client:57877 -> server:80 [ACK] c: client:57877 -> server:80 HTTP GET p: client:1092 -> portal:80 [ACK] p: client:1092 -> portal:80 HTTP GET p: portal:80 -> client:1092 [ACK] c: server:68 -> client:57877 [ACK] ^^ WTF?!? 

在这一点上,连接被洗净。 客户端不期待在该端口上的数据包,并发送一个RST。 每次尝试连接时,断开的端口号都会加1(假设从现在开始,尝试12次就会工作)。 所有重传在响应中都有相同的断开的端口号。 我不知道是什么原因造成的。

这是一个错误,还是我做错了什么? 这台机器有一个不寻常的configuration。 它被configuration为一个桥梁。 为了仅将NAT规则应用于单向传输的数据包,首先使用ebtables NAT规则标记数据包,并在应用iptables NAT时检查该标记。

这是在内核2.6.32-279.5.2.el6.x86_64的Enterprise Linux 6上

NAT规则是:

 target prot opt in out source destination DNAT tcp -- ilb any anywhere anywhere multiport dports http,https mark match 0x8 to:<portal IP> 

ilb是桥梁。