Excuse me, I'm a beginner and I don't understand much. Could you give me a small diagram of how I should make the connections, I will be very grateful.
Measure the voltage delivered by the router source.
If you deliver 12V to 12.5V, there is no problem in connecting the (+) of the battery with the (+) of the source and the (+) of the router.
In addition, you connect the (-) of the battery with the (-) of the source and the (-) of the router.
Once the project is done and you take the corresponding tests, the result is super positive, now the problem is that since the router is installed in a country house when I arrive at the place, I realize that the power supply and the router work with 9v, now the question is: Would it work the same with the reley (HELISHUN HLS8L-DC12V-SC) of 12v 5 or not correct? Thank you very much for your advice.
If the battery is 12V and the router source is 9V, you could damage the router by applying 30% more voltage.
To avoid damaging it, you can lower the voltage with 4 diodes in series. With the scheme you don't need a relay.