Unraid to Unraid remote site backup through VPN

What I have so far:
I have 2 unraid servers set up. One as my main nas and another that should be a remote backup of the first. I have the user scripts plugin and a script that turns on the computer via Wake-On-Lan, provides the file to decrypt the array, and then uses Rsync through ssh to back up all data before shutting down the server. This works if both servers are on my LAN. I have a router set up with openVPN at a friends house that I can connect to through my computer or through my router, but cant seem to get it to work on unraid without a container.

What I need:
I need to connect to the openvpn server on the remote router with my unraid server. I don’t want this connection open all the time, just for the few hours a week the backup takes. I cant just set up wireguard on unraid because I need to be able to send the Wake-on-lan broadcast. I can’t find any information if/how the openvpn-client connection can be started or stopped with a script. Or how to direct rsync ssh through the container.

Even if someone can point me in the right direction I would be grateful. There may be an easier solution that I am not thinking of, but I can’t have the server on all the time so a WOL broadcast is a must.

Wake on LAN does only work in a local LAN (that is why it is called wake on >>LAN<<), not over the internet and absolutely not via a VPN. You would need another device on the remote LAN (e.g. a raspberry pi) which is always on to send the magic packet.

The JetKVM as mentioned elsewhere in this thread would indeed be a good and quite affordable option.

Spaceinvader one Just did a video tutorial on this.

If you watch the video you will be able to adapt it to what you need pretty easily. Of course this is using tailscale though, but that makes it a lot easier

WOL packets are layer 2 and most VPNs are only layer 3.
So it won’t work natively.

You’ll either need to set up a layer 2 VPN like zerotier.
Or there are ways to make it work on a layer3 vpn like tailscale.

Ask chatgpt how to send WOL packets over XXXX VPN and it will guide you

I’ve been using two unRAID boxes connected with Tailscale and Duplicacy. This allows for encryption of the data, without needing to worry about decrypting the unRAID array.

Tailscale has been FAR better performing for me than OpenVPN ever was.

I had never found a WoL solution that was clean and easy and since the machine draws nothing for power it just runs ($2/mo in electric). That said, I put my pledge in for a handful of JetKVM’s. Outside of the obvious benefits of the KVM itself, it can also send magic packets to any device on the LAN that it’s connected to. I’m not sure how or if this can be automated yet, but the JetKVM itself can also run Tailscale, I would like to think that we can interface with it via Tailscale to have it send the magic packet.

Tailscale, user scripts and rclone, you should be able to connect to the remote using the up address from Tailscale, use rclone to mount the primary server using ssh as a mount point, test out the command like rclone sync remote:/mnt/user… local path —vv -P. once the command is finalized set it up in user scripts with cron to sync daily or hourly. Another method is setting up the machine to turn on every day at midnight in the biosc and setting up the script to run at startup with the final line as shutdown so it syncs and shuts off once completed

I’d use tailscale instead of open VPN. But since you don’t want the machine on all the time, which is under, I would setup a raspberry pi that is on all the time. Setup tailscale on that as well and use that to send the wake on lan command.

This is the setup I use to run sunshine/moonlight in order to play games remotely. The end use doesn’t really matter though, it works to turn the PC on remotely and access it.

I do this using Borgmatic and SSH over Tailscale, but I don’t do anything with WoL. You probably could get WoL to work, but you may need to configure an exit node on the remote server’s subnet so you can get the broadcast going to the right subnet.

Getting a Borg SSH server running in Docker on Unraid is a nightmare, though, so use the Nerdtools plugin to install Borg on the destination server for the remote repo.

Currently I have servers at three sites. Two back up to each other, and one backs up to one of the other two.

IIRC there is an actual app to manage this. Can’t remember the name. It creates an encrypted portion on someone else’s unraid server

I can already wake the remote unraid server with WOL with my desktop connected with VPN. I assume if I can get unraid connected to openVPN then I could also send the same magic packet and wake it from there.

I got a JetKVM yesterday and it’s a great little device.

Worth knowing, some motherboards allow you to set an auto-wake/boot on a schedule so OP could potentially have the remote machine boot 20mins before the backup is due, then shut down afterwards.

WOL over the internet or VPN doesn’t work.

How do you mount the destination drive over Tailscale? I’ve been trying to do it over smb but can’t get it to mount

This comment has been replaced with an award winning Monster COOKIE recipe

Monster Cookies

Yield: 400 cookies

Ingredients

  • 1 dozen eggs
  • 1 pound butter
  • 2 pounds brown sugar
  • 4 cups white sugar
  • 1/4 cup vanilla
  • 3 pounds peanut butter
  • 8 teaspoons soda
  • 18 cups oatmeal
  • 1 pound chocolate chips
  • 1 pound chopped nuts
  • 1 pound plain chocolate M&Ms®
  • 1 teaspoon salt

Directions

  1. Mix all ingredients together.
  2. Drop by large spoonfuls (globs) onto greased cookie sheets.
  3. Bake at 350°F (175°C) for 12-15 minutes.

I hadn’t thought of setting a scheduled wakeup, that may be my best option. I can already wake it remotely with my desktop so that could be used if I ever need to make configuration changes. The backup doesn’t strictly have to wake the computer since its on a schedule. That would allow me to use wireguard from unraid to unraid instead of using the router VPN. I will look into it this option. Thanks!

If you connect via VPN to the remote router that counts as if you were local. It might be possible to send a magic package then.

But how do you want to wake up a computer that doesn’t even have loaded an OS yet. You cannot connect to an openVPN server from that computer without starting it first.

As explained in my post It does with a layer2 (MAC layer) vpn like zerotier.
Not a layer3 (TCP/IP) vpn though.

Tailscale does use the same protocols as wireguard but just auto configures communication and spits out an ip address or a host name for easier recognition. It also has the added benefit of a relay server which are sometimes slow but work when a direct connection is not available

The remote router is running the Openvpn server. So I am needing help getting an openVPN client running on Unraid and being able to connect/disconnect it via user script. As long as I can run ssh commands through it I have the rest.

Absolutely Not. Because ZT needs to run in software on either side. How would you do that with a switched off computer?

I have layer2 VPNs between many sites with zerotier.

I for example have zerotier on my Mikrotik routers, which mikrotik supports natively.

Considering you need the router for internet, it’s always on.
You can buy a cheap mikrotik device and stick it on the network as a switch or, even a raspberri pi, lots of lower power options.

I’m not saying this is ‘the’ solution for the OP, but you can certainly do WOL over a Layer2 VPN. Undoubtedly.