the easiest way I can think of would be to add a cron job which pings a dns server by adding a line like this one to /etc/crontab :
#
#┌───────────── minute (0 - 59)
#│ ┌───────────── hour (0 - 23)
#│ │ ┌───────────── day of month (1 - 31)
#│ │ │ ┌───────────── month (1 - 12)
#│ │ │ │ ┌───────────── day of week (0 - 6) (Sunday to Saturday;
#│ │ │ │ │ 7 is also Sunday)
#│ │ │ │ │
#│ │ │ │ │
#* * * * *
* * * * * user ping -c 3 8.8.8.8 &> /dev/null
This command would ping Google's DNS server 8.8.8.8 3 times every minute.
"user" should be replaced with any of your system users.
/dev/null is there to mute the output of the command and prevent it to go in /var/log/syslog
You need to understand though how frequently you are required to ping the server in order to keep your connection alive. Hopefully you don't need to do it every minute.
If the frequency should be in the order of seconds then you need to write a customized script and run it from crontab instead of the "ping" command.
It would be also better to ping a server of yours living outside your network (if you have one) instead of Google's DNS.