How to stop NAT dropping idle connections?
Posted
by
WGH
on Server Fault
See other posts from Server Fault
or by WGH
Published on 2013-10-26T15:14:40Z
Indexed on
2013/10/26
15:56 UTC
Read the original article
Hit count: 264
I have a TCP connection that can be idle for many hours. The traffic is flowing from the server to the client only. One might say it's kind of push notification.
My home router, however, tends to drop the connection silently after 20 minutes (the value of /proc/sys/net/netfilter/nf_conntrack_tcp_timeout_established
). The server detects the loss once it tries to send anything (I assume it receives RST from the router itself). As client never sends anything, it never detects the loss.
RFC 5382 "NAT Behavioral Requirements for TCP" states the following:
A NAT can check if an endpoint for a session has crashed by sending a TCP keep-alive packet and receiving a TCP RST packet in response.
It makes sense. It's much more effective than sending keep-alives by the host itself (as only NAT knows its own timeout). And probably not hard to implement.
Is there any NAT solutions implementing this? It would be great if there was a way to enable this in iptables.
© Server Fault or respective owner