Why do we use Keep Alive parameter ?
Now that is not a solution. You can increase the Keep Alive parameter in your machine so that the machine automatically send a network packet to the network at a regular interval so that the machine does not disconnects. It uses the same technology as used in the case of heartbeat.
How do we change Keep Alive parameter in Linux?
# cat /proc/sys/net/ipv4/tcp_keepalive_time
# cat /proc/sys/net/ipv4/tcp_keepalive_intvl
# cat /proc/sys/net/ipv4/tcp_keepalive_probes
The numerical value in the first 2 files are defined in seconds and the third one is just a numerical value.
# echo 300 > /proc/sys/net/ipv4/tcp_keepalive_time
# echo 60 > /proc/sys/net/ipv4/tcp_keepalive_intvl
# echo 20 > /proc/sys/net/ipv4/tcp_keepalive_probes
Here we have change these values so now the first keepalive probe will be sent after 300 seconds i.e. 5 minutes and 20 probes would be sent before the network is disconnected. And the next packet will be sent again after 60 seconds i.e. 1 minute so this can obviously help resolve my network dis connectivy problem.
# sysctl -p
# sysctl -a
Reboot your machine once to take the changes affect and load your kernel with these new parameters.
Let me know your success and failure.