Ping

One approach is to run something like ping every ten seconds in a terminal window:

ping -i 10 myserver.example.com

Ssh config

A better approach, assuming you are using ssh on a Linux client, is to edit (or create) on the client:

$HOME/.ssh/config

and add the following line:

ServerAliveInterval 60

This will keep it active while the network connection is in place. You may still get dropped connections if the network connection is interrupted.