A script is needed for the server on Centos, which will ping for example the yandex.ru site, and as soon as the response from the site disappears (no response 15 seconds), restart the service network restart until the connection is restored.
PS Ping is not on the crown, but constantly, and as soon as the connection disappears - restart