We've done this many times.
However, I would not recommend doing this to equipment that you don't own. For example an ONU installed by a FTTH network, or a router managed by your ISP.
If you own the kit and you know when end of a soldering iron gets hot, it's a different story...
We use DC regulators to ensure that the voltage is stable.
LM7805 for 5V
LM7809 for 9V - Some TPLinks.
LM7812 for 12V
Don't be shy when it comes to heat syncs for them.
Devices that need 24V, use a DC DC step up. You can source them on ebay if you have time on your hands or at ACDC or Mantech if you need it now.
A 33ah battery used for electric gates will see you through load shedding.
The expensive component of this equation is the charger. You need a clever charger, such as a Meanwell or a Ctech - at least 10A as you have to have the battery back up to charge before the next round of load shedding.