How can I get a synology NAS to automatically connect to a VPN Server on a remote NAS when the NAS only comes on once a week for a backup window?

I have my home NAS that I backup to a remote synology that comes on once a week. I connect to the NAS via OpenVPN and have a hyper backup job scheduled for that backup window. Using default Synology VPN server and VPN client option in networking.

I can manually initiate the VPN connection when the remote NAS is on, but since the NAS isn’t always on, if I try to connect to the VPN in an automated manner even if I select the “reconnect when connection fails” options it does not reconnect to the VPN when the NAS powers on which means the backup fails.

I am assuming when the remote NAS shuts down, the local NAS retries to connect to the VPN server x times and then it seems to stop trying.

Is there a way to force a reconnection when a backup job starts or via some other scheduling method?

wont it make more sense to set up vpn server locally since it’s always on

so when the remote nas power on, it automatically connects to your vpn server?

If I were you I will just use Tailscale for both NAS, much easier to handle in such scenario.

I use a small variant of this for establishing and keeping alive a VPN connection from a synology

https://gist.github.com/hannesbe/03020b0f9662a9e973f7cceadcdf0208

I guess I could try that but I figured it was safer that the server was on the remote device so I can access it since it is unattended but I suppose there is no harm setting up two VPN servers.

Have you tested the VPN client to see if it auto connects on power on?

Never heard of it! Would I still need to encrypt backups?

I haven’t been messed with the built-in VPN, only google and check how synology behave when trying to connect to vpn if you check the option

“Reconnect when the VPN connection is lost: If the VPN connection is unexpectedly lost, the system will attempt to reestablish the connection five times, attempting once every 30 seconds.”

to me it make more sense to setup vpn server locally,

you can also check out the tailscale package on the Synology nas

https://tailscale.com/

I have been using tailscale instead for vpn need.

Encrypting backup is to prevent someone else to read your files freely, while the VPN is more on the transmission session, they are different things.

Sorry I meant currently I encrypt the traffic with the vpn. Does tailscale do that too or do I have to do something else to make sure the transmission is secure

I recommend you to read the technology behind Tailscale, then you’ll have the answer.