About Sysctl and Keepalive
About Sysctl and Keepalive
Linux kernel parameter can be changed on the fly using sysctl command. Sysctl helps to configure
the Linux kernel parameters during runtime.
# sysctl a
# vi /etc/sysctl.conf
# sysctl p
# sysctl w {variable-name=value}
net.ipv4.tcp_keepalive_time = 60
net.ipv4.tcp_keepalive_intvl = 5
net.ipv4.tcp_keepalive_probes = 6
The above settings will cause keepalive packets to be sent every minute. If a response it not receive it will resend
the keepalive packet every 5 seconds. After 30 seconds, it will reset the socket connection if 6 keepalives fail to get
through. This allows a cable to be disconnected and reconnected for up to 30 seconds without dropping the
connection, but it will also re-connect in less than 2 minutes if a device reboots or shuts down without properly closing
the TCP/IP socket.
Reboot Linux
From the console on the local machine, or from a remote login SSH session, issue the following Linux command to
shut down the Linux machine, and restart it:
$ shutdown -r now
Your new keepalive settings will be loaded, and Cigorn will restart.
To view the current keepalive settings, use the config command from the Cigorn command-line interface.