yasamoka wroteIf your router is 12V, get a 12V sealed lead-acid battery and connect the router's adapter to the battery terminals and the router.
connecting a non smps directly to dc will not work it will actually cause a short circuit in the primary winding of the adapter main step down transformer.
what you can do though is bypass the adapter and connect the router directly to the battery but this may on some routers cause some small Surface-mount 0ohm resistors to pop and this is because of the current surge while the capacitors are charging fast and there is no current limiting, so to be safe you can use a 7812 voltage regulator with a 40amp battery and your router will stay up couple of days.