IPTables Port forwarding rules does not work in internal network
I have the following iptables rules on proxy host, which forwards traffic to Server:
iptables -t nat -A PREROUTING -d $host_ip -i eth0 -p tcp -m tcp --dport $host_port -j DNAT --to-destination $server_ip:$server_port
iptables -t nat -A POSTROUTING -p tcp --dport $server_port -d $server_ip -j SNAT --to $host_ip
For one server(call it A), when i try to connect with echo client using proxy host_ip:host_port it works fine and client is connecting to server A, server_ip:server_port.
For other server(call it B), when i try to connect with echo client using proxy host_ip:host_port it does not work and there is a strange behavior.
Connection success rate of echo client is about 1%. About 100 attempts, one is successful. Period of successful attempts is not regular, it can be successful 1 of 300, or 3 of 100.
• Tcpdump logs were collected on proxy host and server. The analysis of these logs showed that the proxy server forwards traffic to server, server sends a response, but proxy server does not receive it (i.e. it is visible in the server dump that the response is sent to proxy, but there’s no corresponding packet in the proxy dump).
• An unexplained correlation was found: when an attempt is done to connect other client to the same echo-server (simultaneously with running echo-client), responses from the echo-server are received successfully by the echo-client.
What can be root cause of this issue? Should we find the problems on server B or on proxy server? Please, help.
Last edited by BushNik; 11-06-2012 at 01:20 AM.