I hope you are well.
I set up OpenVPN on VPS for 5 clients (but I only use 3). I noticed that OpenVPN automatically reboots every day at 4 am. So far so good; The problem is that of the 3 client devices, only two reconnect to OpenVPN and the other (Raspberry Pi4) does not reconnect to OpenVPN until I reboot raspberry pi itself.

I wanted help from you with a command that makes raspberry reconnect with OpenVPN when it reboots.

Note: The settings for raspberry pi are well done because when I reboot raspberry it reconnects to OpenVPN automatically, but when OpenVPN reboots, raspberry pi doesn't reconnect to OpenVPN.

Or if you would help me so that OpenVPN doesn't auto-reboot, just when I do.

Thanks in advance for any help.

Have a nice start of the year.

Good morning friends, I come here to bring the test results of the tips you gave me yesterday.

As you can see, OpenVPN on the raspberry pi4 client, at exactly 05:00:30, where the log shows (Jan 8 05:00:30 raspberrypi dhcpcd [399]: wlan0: carrier lost).

Remember that the OpenVPN server always restarts at this time (I don't know why and I didn't configure it). At least if I could disable this OpenVPN server autostart setting.

Updated enter image description here

  • Scheduled sudo service openvpn restart on crontab?
    – M. Rostami
    Jan 7, 2020 at 18:30
  • Thanks. On Openvps server or openvpn client?
    – nuxuser
    Jan 7, 2020 at 21:07
  • On vpn client, however, there is some solution if the vpnserver rebooting is a problem and you didn't configure like this.
    – M. Rostami
    Jan 7, 2020 at 21:09
  • Good. So what would be the solution? I honestly did not configure the reboot, it may be that the commands I used already include autostart but each command had its description and I read it carefully. I would like to disable this setting. Thanks in advance for your time and support
    – nuxuser
    Jan 7, 2020 at 22:06
  • 1
    Please don't post pictures of text. Instead paste the text into the question.
    – Ingo
    Jan 9, 2020 at 10:57

1 Answer 1


You can restart the openvpn client service on the Raspberry Pi.

Edit jobs list:

crontab -e  

Add this line:

10 4 * * * service openvpn restart  

It will restart the openvpn service of the Raspberry Pi every day at 04:10' AM.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.