nat with iptables, re-connecting fail within about 3 minutes

Posted by xpu on Server Fault See other posts from Server Fault or by xpu
Published on 2011-11-14T08:12:12Z Indexed on 2011/11/14 9:56 UTC
Read the original article Hit count: 198

Filed under:
|
|

i constructed a nat with iptables, as following:

echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -I PREROUTING -p tcp --dport 9000 -j DNAT --to xx.xx.xx.xx
iptables -t nat -I POSTROUTING -p tcp --dport 9000 -j MASQUERADE
service iptables save
service iptables restart

the configuration worked fine, but there was a problem when i disconnected and tried to reconnect again, connection will be refused within about 2~3 minutes, after that, things go fine again.

what was the problem? how do i make it to accept new connection after the old one break?

© Server Fault or respective owner

Related posts about iptables

Related posts about nat