Command Reference TCP Commands
11 TCP Commands
11.1 ip tcp keepalive
Use this command to enable the TCP keepalive function. Use the no form of this command to restore
the default setting.
ip tcp keepalive [ interval num1 ] [ times num2 ] [ idle-period num3 ]
The interval of sending the keepalive packet, in the range from1 to
120 in the unit of seconds, The default is 75.
Keepalive packet sending times, in the range from 1 to 10. The
default is 6.
Idle time, the time period during which the peer end does not send
any packet to the local end, in the range from 60 to 1800 in the unit of
seconds. The default is 900.
The function is disabled by default.
Global configuration mode
The keepalive function enables TCP to detect whether the peer end is operating properly.
Suppose the keepalive function is enabled together with default interval, times and idle-period
settings. TCP begins to send the keepalive packet at an interval of 75 seconds if it does not receive
any packet from the peer end in 900 seconds. The TCP connection is considered invalid and then
disconnected automatically if the device sends the keepalive packet for six consecutive times without
receiving any TCP packet from the peer end. This command applies to both IPv4 and IPv6 TCP.
The following example enables the TCP keepalive function on the device and sets the idle-period
and interval to180 and 60 respectively. If the device sends the keepalive packet for four consecutive
times without receiving any TCP packet from the peer end, the TCP connection is considered invalid.
Ruijie(config)# ip tcp keepalive interval 60 times 4 idle-period 180