So I want to setup a remote backup location at my parents house although they are very mindful about there electricity usage and environmental impact (and so am I) so I don’t want to have to have a pc always on when it doesn’t need to be.

Is it possible to setup remote Wake-on-lan so I can schedule my homelab at my place to wake up the server at my parents house and start a backup like once a week, I want to do this in a secure fashion as well so ideally no port forwarding, I currently use cloudflare tunnels for my home network.

Are there any other options or do you have a similar setup at your place?

  • cmnybo@discuss.tchncs.de
    link
    fedilink
    English
    arrow-up
    1
    ·
    11 months ago

    You could use a very low power computer that’s always on like a Raspberry PI Zero W to send the WoL packet to the backup computer. It only uses about 1 watt. Some routers have the ability to send a WoL packet as well.

    • pineapple@lemmy.mlOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      11 months ago

      thats a good idea, although wifi is not reliable enough for me. Although I found this guide which shows how to add an ethernet port to a PI zero w so hopefully I can use that. Or maybe I should just use a ESP32.

    • JustEnoughDucks@feddit.nl
      link
      fedilink
      English
      arrow-up
      0
      ·
      11 months ago

      You can even use an ESP32 or similar since it just has to perform 1 tiny function.

      Getting an WT32-ETH01 knockoff dev board for 15€ or PoE for 25€ and uses <300mW with the wireless modem off. You could even just use a WiFi module for 8€ if you don’t want something wired.

      https://registry.platformio.org/libraries/a7md0/WakeOnLan

      There is already an wakeonlan library to generate a packet very easily.

      You can even do it in pseudocode with ESPHome if you have HomeAssistant

      https://community.home-assistant.io/t/solved-wake-on-lan-packet-from-esp32-to-ha-server-how-to-automate/617595

      Then VPN in, send a signal to the esp using one of various methods to tell it to send the packet.

      • WhyJiffie@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        1
        ·
        11 months ago

        Then VPN in, send a signal to the esp using one of various methods to tell it to send the packet.

        this sounds like it requires another computer already turned on

        • faercol@lemmy.blahaj.zone
          link
          fedilink
          English
          arrow-up
          0
          ·
          11 months ago

          Depends on your hardware. My routers can serve as a Wireguard serveur, so no need for a computer for that part

          • WhyJiffie@sh.itjust.works
            link
            fedilink
            English
            arrow-up
            1
            ·
            11 months ago

            the only router firmware I have seen be able to do that is openwrt, and maybe mikrotik’s. none of these are common though, but if you can do this then yes this is a pretty efficient solution

      • BCsven@lemmy.ca
        link
        fedilink
        English
        arrow-up
        1
        ·
        11 months ago

        Wireguard between you and remote device like a pi. Set pi to portfowarding and masquerading on. It will then let you be on say a 10.x.x x network remotely but will send info on the remote LAN like it came from that pi local IP

      • cmnybo@discuss.tchncs.de
        link
        fedilink
        English
        arrow-up
        0
        ·
        11 months ago

        Use SSH. Ether open a port in the firewall or connect it to a VPN. If the backups are done on a schedule, you could also setup a cron job on the Pi to send the WoL packet a few minutes ahead of time.

  • Anonymouse@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    11 months ago

    Similar to others, I do this but the reverse direction. I have a Pi with HDD at a friend’s house. On a timer, it wakes up at 3am, boots to a VPN and initiates an rsync (pull) with it’s twin Pi at my place. When the sync is done, it powers down or the timer cuts power at 9am.

    Other than clock drift due to power outages, I’ve had no issues.

    I have a directory that i can put scripts into and the remote Pi will execute anything in this directory after the sync and before the shutdown. Logs from the rsync or scripts are pushed back to a different directory on the local Pi.

  • Brickfrog@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    0
    ·
    11 months ago

    Wake on LAN is a LAN feature, not WAN, so you’d need to issue that over the local LAN there at the house. You’re going to have a hard time trying to get that working over the WAN (if that’s even possible).

    The other comments mentioning a scheduled boot would be a much easier/simple solution if it works for you.

    But I’ll throw this in, the super basic least tech solution to this is to open a port forward to the house’s network router. Yes, I know you don’t want to do that, but it’s probably the only network device at that house that’s actually on 24/7 right? And by all means lock it down however you like. My simple method is to open the router login to a non-standard port number, with a IP whitelist, add my own home IP address to that IP whitelist, and bam you now have access to that remote home’s router for just your IP address. Log in remotely, issue a wake on LAN via the router’s own web ui, done.

    It’s perfectly reasonable to make this a bit more secure if you wanted but it gets slightly more complicated - open a non-standard port for SSH access to the remote router’s SSH port that only allows SSH login with key. Generate a SSH key and share that key with yourself, then you can log in remotely to that remote house via non-standard SSH port using the SSH key (no user/passwords). From there you’d have to see if you can issue Wake on LAN on the SSH command line, or set up a SSH tunnel from that remote LAN to yours so you can proxy into the router login page and do your Wake on LAN from there. … yes I realize this got complicated :/ But you’ve got a few things to explore given your patience for tinkering with this stuff :)

    Of course much of this relies on that house’s router having any of these features to enable and configure. The main takeaway here is that Wake on LAN requires something on 24/7 at that remote LAN for you to enable remote access into and issue a Wake on LAN command within that LAN. How to actually accomplish that is the tricky bit.

    • SteveTech@aussie.zone
      link
      fedilink
      English
      arrow-up
      1
      ·
      11 months ago

      You’re going to have a hard time trying to get that working over the WAN (if that’s even possible).

      Wake on LAN is still encapsulated in an IP packet, so you can send it over the internet, and most WOL clients let you specify an IP. However your router will need to DNAT it to a broadcast address. Some routers have a check box for this (e.g. An ISP provided Technicolor router I have), some let you port forward to broadcast (e.g. Many routers, sometimes with workarounds), and some let you manually configure NAT (e.g. MikroTik routers).

      So it is possible, but forwarding public internet traffic to a broadcast address seems like a bad idea, and I wouldn’t recommend it. Why I know this: I used to do this in middle school, and it does work quite well.

  • drkt@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    0
    ·
    11 months ago

    I’ve been mentally experimenting with an ESP32 hooked up to my desktop’s PWR header with a switch. I’ve done worse than that before, so I know it’ll work. I just haven’t gotten my ass around to it. I can send commands to it through my domain via Apache acting as a reverse proxy.

    • antimongo@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      11 months ago

      Hey I did exactly this a few years ago! Uses an optocoulper for isolation. I flashed ESPHome on it and connected it to my Home Assistant instance.

      Works like a charm!

      I also hard wired the ESP power pins to the PC via a spare USB header. Then I enabled a BIOS setting to keep USB ports powered when shut down, so it’s a super seamless install.

      Only problem I’m having with it lately is since I run a dual boot system, my default GRUB option is Linux, but sometimes (unfortunately) I need to get into Windows. It’s a bit of a pain to have to update grub to change the default then restart again. I’d rather build in some sort of selection functionality the first time it boots.

      I’ve been playing around with using another ESP32 as a filesystem device, then having grub read the content of a file on the other ESP32, either “windows” or “linux”, then booting accordingly. That’s a work in progress tho