Connection lost after reboot

  • Hi!


    I installed OMV on my RPI4. It was working fine, but then I changed some config on the web UI (maybe I renamed the eth0 to something else, not sure), rebooted and it did not connect to internet anymore. I already had WireGuard on the RPI, so maybe that combination was incompatible.


    I am not able to physically access the RPI (it is in another country), the best I could do was to ask somebody to insert a fresh SD card with Raspbian inside and now I have mounted the previous installation as external drive and can browse the files.


    Is there a way to revert everything that OMV did to my network setup, so I can reboot from the old disk again and be sure that it will be able to connect to the internet next time?

  • chente

    Approved the thread.
    • Official Post

    Indeed, that combination is incompatible. The Wireguard plugin needs to know what the network interface is to set the iptables configurations in the tunnel. If you have access to that USB card you can modify that value manually. For that you have no choice but to edit config.xml if you feel comfortable doing so. If you make a mistake you can lose OMV.

    - Make a backup of /etc/openmediavault/config.xml

    - Edit /etc/openmediavault/config.xml

    - Look for the wireguard section and within it look for the tunnel. Modify the value of <nic> to the new one you configured in OMV.

    With that you already have the OMV database. Since you cannot run omv-salt deploy run wireguard you will also have to manually modify the wireguard configuration files. Go to /etc/wireguard and edit the tunnel file. It will probably be called wgnet1.conf. In the PostUp and PostDown lines you will find something similar to this:

    Code
    PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eno1 -j MASQUERADE
    PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eno1 -j MASQUERADE

    You must modify the name of the interface to the new one, if it is eth0 it will look something like this:

    Code
    PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
    PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE

    With that Wireguard should work if everything else is fine.


    If that server is in a remote location, I suggest that in addition to the plugin tunnel you also configure a Wireguard container with an alternative tunnel. This will give you another access path to the server. If the plugin fails for some reason you have the container and vice versa.

  • Thanks for the reply chente!


    I actually do not care about losing the OMV, because it is was a fresh setup, compleately empty.

    What will happen if I will remove the config.xml compleately?


    PS. There is no Wireguard section, but I do see the interface that I most likely renamed there, but I have not idea what are the right names.

    • Official Post

    What will happen if I will remove the config.xml compleately?

    If you delete the config.xml file you delete OMV, don't do it.

    There is no Wireguard section

    That is impossible, if you have installed the Wireguard plugin you must have a Wireguard section in config.xml.

Participate now!

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