Would like better Network reconnection features for OMV

  • Recently I was going a large file transfer of backed up data from my OMV NAS to my new gaming PC. There were over 30 GB of files. The file transfer (over WiFi network) stopped midway because my computer lost connection with the OMV server and it did not reconnect after a few minutes. I'm pretty sure it is because of my spotty home internet, because a few times a day I have to manually press reconnect to join my home wifi network on my computer running Windows 11. However, if my NAS gets booted offline, there is no GUI to tell it to reconnect as I have no monitor equipped to it.


    I realised I could plug it in with ethernet to my PC or laptop, but for remote only operations, it would be nice if the OMV software connected back to the network after a drop. After the server failed, all I can do is turn it off and back on, restarting the server, and waiting for it to connect to my home WiFi network (It doesn't want to reconnect to the WiFi/ try multiple times after unsuccessful connections). This isn't ideal because if my home wifi is still being inconsistent for hours and I forget and close file explorer, then suddenly the 15 GB data transfer has stopped and I can't go back.


    So it would be nice if the OMV software could reconnect and resolve network issues itself, as it hasn't done so in my situation.


    Version: Sandworm 7.4.15-2. Kernel: Linux 6.6.62+rpt-rpi-2712. Device: Raspberry Pi 5 Model B Rev 1.0

  • chente

    Approved the thread.
  • OMV, being a server is always best connected by cable to your network. However if wifi is your only option, the easiest way to tackle that in OMV would be to write a little bash scrip that would check for network connection by pinging your router, and if it can't ping the router, it will restart the network services to re-establish the connection. Then schedule that script with the task scheduler to run every few minutes.


    I don't have time to fully write one and test it now but you can probably find one with a little searching that you can modify.


    basic concept would be something like this though, (change the ip address to match the ip of your router).

    This will ping the router and exit if the ping is successful but if it isn't it will restart the network manager to re-establish a connection.


    Bash
    #!/bin/bash
    
    if ping -q -c 1 192.8.8.8; then
        exit 0
    else
       systemctl restart systemd-networkd
    fi

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!