Linux – Is net.ipv4.vs.timeout_timewait used also for IPv6

ipv6linuxtcp

Does this setting for TCP net.ipv4.vs.timeout_timewait apply only to TCP connections established over IPv4 or does it also apply to TCP connections established over IPv6?

I have found this for example

/sbin/sysctl -w net.ipv4.vs.timeout_timewait=60
Sockets will linger in TIME_WAIT state for no more than 60 seconds.

But no information if it is applicable to IPv6.

Best Answer

Some kernel IPv4 options also apply to IPv6. From the latest stable kernel sources, we see that the TIME_WAIT interval is already set to 60 seconds:

#define TCP_TIMEWAIT_LEN (60*HZ) /* how long to wait to destroy TIME-WAIT
                                  * state, about 60 seconds */

In Linux operating systems this option is not configurable. Please check the following discussion for more details.

I would also recommend reading this article to get some understanding how to configure the TCP TIME_WAIT properly.